I recently had to change the wifi settings on four cameras, so I had to go through this pain again - and yes I still have a lot of trouble.
I have two suggestions.
The one that has been working for me is this: Set the phone up so it is the approximate five inches or whatever from your camera, ready to go. Then place your hand or something else in between the camera and the phone, wait maybe five seconds, then remove. This seems to force the camera to re-focus and sometimes works. It’s still frustrating, but I have been able to eventually get it to work that way.
One other thing I mean to try, based on a kind of a long story. I was at Container Store, and had a 20% discount scan code on my coupon. It wouldn’t scan in, and I figured it’s just hard to get right, but the checkout person said, can you set your phone to maximum brightness? On my iPhone I swiped up to get Control Center, then maxed out the brightness, and the scan went right away.
So next time I am in this bind, I’ll try that as well. I don’t mess with my phone’s brightness setting, never even really think about it, but maybe at some time it has been set lower whan the camera likes. Something to try, post your results.!