Hello GVSSC,
A restart of your iPhone (Restart your iPhone - Apple Support) would be the first step we advise that you take to try to resolve this behavior. This step can frequently help with issues of this type.
“1. Press and hold either volume button and the side button until the power-off slider appears.
2. Drag the slider, then wait 30 seconds for your device to turn off. If your device is frozen or unresponsive, force restart your device.
3. To turn your device back on, press and hold the side button (on the right side of your iPhone) until you see the Apple logo."
Make sure it is also updated (Update your iPhone or iPad - Apple Support) as outdated software can cause unexpected behaviors.
“1. Back up your device using iCloud or your computer.
2. Plug your device into power and connect to the internet with Wi-Fi.
3. Go to Settings > General, then tap Software Update.
4. If you see more than one software update option available, choose the one that you want to install.
5. Tap Install Now. If you see Download and Install instead, tap it to download the update, enter your passcode, then tap Install Now."
Also, if you have any apps on your iPhone that use the Camera make sure those are up to date as well: How to manually update apps on your Apple device - Apple Support.
“1. Open the App Store.
2. Tap your profile icon at the top of the screen.
3. Scroll to see pending updates and release notes. Tap Update next to an app to update only that app, or tap Update All."
We hope this helps. Let us know if we can assist with anything else at all. Take care.