In my situation it actually hasn't happened the past few days so I'm hopefully ok lol. But it did not turn itself on just off. As if someone yanked the cable.
Thanks I will try to leave it alone for a while if it ever happens again just to see. It could have been a fluke, the power supply wire is sort of loose. In case something happened I have since moved the power supply away from any risk of nudging. It's weird but it has held just fine ever since I posted about it which is pretty funny.