This is a common fault because the camera function file is damaged for some reason.
Solution:
Computer model: MSI GF63 Thin 9SC
System version: Microsoft Windows 10?
Brand model: iPhone 12
System: IOS 14.6
Install a PP assistant in the computer first. After the mobile phone is connected to the computer, open the PP assistant and identify your mobile phone.
Click the file in the lower left corner and the file system (user) in the middle column. You will see a photodata folder, and enter it. Delete all folders and files in the folder (do not delete photodata, delete the content).
Just restart the phone. Remember, the photos are empty at this time, but all photos will be restored in a few minutes. In the meantime, don't disconnect the phone from the computer.
Note: This operation will not lose photos, because it is not the photo file that is deleted, but the photo function file. If you are not at ease, you can use PP assistant to back up the original file first.