Resurrecting this. I'm still using a 2013 iMac in 2023. I was experiencing random shutdowns and the computer would not turn back on until it was unplugged. I replaced the power supply, but after sealing back up my mac it started doing it again. I believe in my case, the iMac was overheating. I looked up with a flashlight up into the bottom vents and there was dust visible. I turned off the computer, did a thorough careful vacuum and have been monitoring temperature with Macs Fan Control. So far, no more random shutdowns.