There are diagnostic test tools in your Samsung Members App under the GetHelp section , Diagnostics and also by launching your phone app and keying in *#0*#
Try also clearing the cache of the camera app via settings, apps,camera,storage,clear cache.
If you still feel there is an issue then seek support from a Samsung Experience Store / Samsung Service Centre.
I wish you all the best with this situation.
Current Phone > Samsung Z Fold³ 5G. > Software : Android 12 ~ Samsung One Ui 4.