Same issue - 2015 27” imac with i7 processors. Had the Logic Board and PSU replaced but still had issues 2-3 weeks later. Had it sitting on a shelf for the last 18 months. Got it out and wiped the OS drive, reinstalled Mojave, and it ran great for a full month. Now it won’t even get all the way through POST before shutting down again. I have to do an SMC reset just to get it to respond to the power button. I have always run it on a UPS, so no idea what could be causing the issue.