Hi tatussy,
Thanks for using Apple Support Communities. It sounds like you’re having trouble with your iPhone unexpectedly turning off. I’m happy to provide some troubleshooting steps.
If you haven’t already, I suggest updating to the latest iOS version:
Update your iPhone, iPad, or iPod touch - Apple Support
If that doesn’t help, you may want to reinstall iOS. While the title of this article may not seem relevant to your issue, you’ll want to follow the steps under “Put your device in recovery mode and set it up again”:
If you can't update or restore your iPhone, iPad, or iPod touch - Apple Support
Should the issue persist, you’ll want to contact Apple Support for further assistance.
Take care.