This is a commonly known and widely reported HW defect of 3/3T devices, the rear camera looses the ability to focus, or fails to function completely.
If the issue persist after factory resetting the device, take or send your device into a OnePlus service center to have the rear camera module replaced.
In the future pls use the forums search before creating unnecessary threads like this one.
My oneplus3 rear camera also not focus
weekend fun time - a temporary megachat with a prize
by Cheetosdust, 2019-08-23