CPU failure, try another if you have a spare. I had a similar issue with a dell 720, no other codes but would randomly switch off with no warning, replaced all the ram, went to replace the motherboard but thought to check CPU first. Glad I did and had a spare, been solid ever since. YMMV but good luck 👍
Cheap second hand gaming set up/workstation will be more than powerful enough for your use case and shave off a lot of power at idle, aim for the newest CPU you can afford without investing too much into the GPU ideally