How long have you had your phone exactly? Are you seeing an alert when you check settings>general>about>parts and service history?

Iphone 13 pro and pro max cameras have well known and widely reported issues you will find others talking about, on this site and with a simple google search, for which apple has not accepted responsibility. My 13 pro malfunctioned in a similar way with the end result being the alert included above that says unable to recognize if genuine apple part (which it absolutely is the genuine part since my phone was purchased brand new and has never been repaired or opened). The other result was losing the .5 zoom and 10x zoom. Camera automatically defaults to 2x zoom and .5 isnt even an option anymore as it was before. The camera can only range from 1x to 5x.
Happened shortly after i bought the phone in 2022 and most people have found its a common hardware issue but again, apple refuses to acknowledge that and unless you are within the limited warranty period they will likely charge you to replace the camera.