Hi Macca_21,
Thanks for posting in Apple Support Communities! Since your iPhone is shutting down unexpected, check to ensure your software is updated. Outdated software can cause things to misbehave, and updates can resolve many issues:
- "Back up your device using iCloud or your computer.
- Plug your device into power and connect to the internet with Wi-Fi.
- Go to Settings > General, then tap Software Update.
- Choose the software update that you want to install. You can choose to stay on iOS or iPadOS 15 and still get important security updates. Or you can choose the option to upgrade to iOS or iPadOS 16.

5. Tap Install Now. If you see Download and Install instead, tap it to download the update, enter your passcode, then tap Install Now."
-Update your iPhone or iPad
Should it continue, check to see if your battery is requiring service. This information can be found in Settings > Battery > Battery Health. If it requires service, contact Apple Support to go over options.
If its updated and battery service isn't required, let us what happens after the screen goes black. Do you see a spinning gear, Apple logo, or battery symbol when trying to force restart it? If you leave it, does it restart on its own?
Cheers!