i've had this before WAYYY back when i had an iPhone 7 (which was atleast 3 to 4 years ago i believe), from what i know based off of knowledge of electronics, software, etc, it is for SURE a hardware problem and you'll probably have to take it to an apple store for them to examine and fix it, i personally didn't get it fixed when i had it but honestly they'll probably fix it, i noticed it was either the hardware that allows the phone to focus is broken OR it has to do with the camera's stabilization but since it's not mechanical i REALLY doubt its this, or it could honestly just be the mechanical shutter but it looks like it has to do with focusing itself, so basically this is a hardware problem and i'd suggest taking your phone to an apple store because there is no way for software to fix this unless you use a third party app to manually focus (which even then may be a bit weird), if you have any contradictions to this, questions, comments, or honestly anything feel free to reply and i or someone else would love to help further (honestly i'm always on apple discussions so for sure i'll notice it atleast)
edit: i am noticing someone in particular who's a part of one of apple's beta program's who said his problem was fixed with 14.2 beta 3, so ok maybeee its a software thing but still, i'm going to keep this because honestly it sounds to be the same problem as your having, idk, honestly if you want you can wait for the public release of ios 14.2 and if its not fixed THEN go to the apple store but its up to you