Lenovo desktop keeps turning off after a few hours of use?

I got a Lenovo desktop PC a year ago and it worked great… For about 8 months. Then it started randomly turning off. After shutting down, I can't just press the power button for it to turn back on; I have to unplug and replug the power cord (no power switch on PSU) for it to understand that I'm pressing the power button. It only turns on in short sessions now and I have to be sure I save all my work before it does so, because there's no warning for it. It just… Shuts down. I eventually figured out that the longer I waited before turning it on again, the longer it would run. I have also narrowed the problem down to something being wrong with my PSU which is an FSP400-40AGPAA.
I tried to switch the PSU out for a Corsair CX650M, but, because Lenovo wants people to suffer I guess, none of the connectors are standard and it wouldn't fit the system (haven't looked into getting adapters).

This is my PC: https://www.newegg.com/...6883795102

So two questions: am I right about what's going on with my PC and how should I go about replacing the PSU if that actually is the problem?

You can try buying a new PSU and see if the problem persists.

Two things to check look in the back of your power supply unit and make sure that the fan to your power supply unit is spinning if it's not you know you need a new power supply look at your CPU fan and see if it is spinning if it is not spinning right you know you need a new CPU fan

They sell adapters on amazon for these janky computers with proprietary connectors.

https://www.amazon.com/...00WE5KSFQ/

https://www.amazon.com/...0163KB3L0/

You have a overheating issue. It could be the power supply or another part inside your PC such as the CPU. Sounds like a power issue to me though.

If the PSU fix doesn't pan out, use Speccy or HWmonitor to track system temperatures.

Lenovo makes cheap copies of computers from the IBM designs that they got from purchasing PC business over a decade ago. Don't expect top quality from their lower prices.