I’ve found that it gives me a decent skeleton of something that I can then apply to my actual problem, but not much more, and it usually comes with some pretty big mistakes. I was trying to learn Z80 assembly and it gave me a good idea of how my code should generally look, but I did end up having to rewrite a whole bunch of it before I could actually execute anything.
My bet is on either thermals or power supply.
Not likely to be RAM, since issues there are more likely to either prevent the machine starting in the first place, or lock up if it fails while the machine is in operation.
Not likely to be CMOS battery since that generally wouldn’t cause the machine to shut off, it just preserves firmware settings between power cycles.
In theory, there could be an intermitted short happening somewhere and the PSU’s OCP is kicking in, but I’ve never come across something like that. Similarly, there could be a problem with an internal power cable connection doing the same, but it sounds like you’ve already checked that.
I would test with a different PSU if you can. Thermals should be easy to check for too with the many pieces of available software to keep track of such things.