To give a bit more detail I have an iPhone XS that doesn’t always turn off but every so often when taking photos will cause it to shutdown even if it has battery it then won’t turn back on until you provide charge (like a jump start) after receiving a brief charge it comes back to life and doesn’t do it again for a while. I can replicate it if I take sometimes 10’s of photos sometimes 100’s.
The only thing I’ve changed is the battery which is on its third now however the most recent was from ReplaceBase so decent quality. I can’t find any panic logs to show what’s happening.