I had a similar issue with a previous Samsung phone and found by gently tapping near the camera module made it auto focus.
Something appeared to be stuck.
Take the phone to a Samsung Service Centre who'll check it out.
I wish you all the best. Take care. 😎
Daily Driver > Samsung Galaxy s²² Ultra 256Gb in Phantom Black.
The advice I offer is my own and does not represent Samsung’s position.
I'm here to help.