Chosen Solution
SPOILER: THE PHONE DIED YEARS AGO I’M JUST CURIOUS ON WHAT THE ISSUE COULD BE. My Iphone 4 began giving me these ramdom shutdown issues. The phone would turn off by itself if left unplugged for more than five minutes. It dind’t matter if it was used or in iddle or the batery porcentage. You could turn it on as soon as it finished shutting down and it will appear in the same porcentage as when it shut down. The batery was replaced three times over the course of a year, keeping the same issue with every replacement. Eventually, it turned off while charging and never turned on again.
It’s probably a logic board issue.