Chosen Solution
Sometimes my phone shuts automatically without my permission. Recently, it is doing frequently.
@adiv intermittent failures are the toughest to figure out. From what you are describing it could be a power problem. I would replace the battery and re-evaluate. Use something like this video to change the battery.