Try Settings, Apps, Camera, Storage and clear cache.
If that does not help go into your Samsung Members App under the GetHelp section and run the diagnostic test tool.
There is also a diagnostic tool via your phone app and in the keypad type in *#0*#
If that does not help and your camera software is up to date as well as your phone then you may need the help of a Samsung Service Centre.
I wish you all the best.
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. " This is the way. "