Had a similar problem on a pc some years ago, I changed everything power supply motherboard etc. Thought I had cured it but no it started turning off. Turned out to be the on switch on the case changed that and put all the old bits back. I still cannot figure what was wrong with the switch as they are just a momentary on type or should be as holding them in will of course power the thing off.

worth a try, start the pc then pull the switch connector off the motherboard to see if it still powers off.

peetr