I have used Sony Xperia X Compact, Sony XA2 (both with official SFOS) and now Sony XZ2 Compact (SFOS community Port).
My observation with Jolla Camera App on these 3 Hardware-Platforms are always the same. It doesn´t seem to utilise the Hardware-Distance-Sensor (Sony call this “Laser Autofocus” for the X- and XZ2-Compact) for fast and correct Focus. So it seems it has its own Software-Implementation (Zoom and compare contrast boundaries) which isn´t fast and gives the optimal result in most cases.
Maybe theres no access to the Depth-Sensor it or its buggy in the AOSP-Blobs.
I experience a similar behaviour on LineageOS with the Sony XZ1 Compact and the Sony XA2.
AdvancedCamera seems to handle this better Softwarewise but can´t utilise the Hardware-Camera-Button.
So things will improve maybe with CamperaAPI 2.0 hopefully.
Please correct me if statements are wrong.