Unexpected mains power shutdown
My late 2015 iMac 27 5K developed a fault earlier this year: it started shutting down unexpectedly, initially once or twice a day up to every two to three minutes. I checked the power cord, used different power outlets in different parts of the house, booted in safe mode, checked the syslog file for any error messages which could explain this, no explanation found. Important: after each unexpected shutdown I had to reset the SMC to get the machine to react to the power-on button again.
Took it to the Apple store for a repair. As the machine displayed these unexpected shutdowns while at the store they replaced the logic board and the power supply. Machine worked fine for a few weeks and then started shutting down unexpectedly again. Back to the Apple store again where this time the machine apparently ran fine for one week without any problem.
Back home within two hours started shutting down again, now every two minutes, so unusable. Does anybody have any idea what could make the SMC shut down the machine? Is it a (false) high temperature warning?
Which other part might need replacing?
Could there be another problem causing damage to the logic board and/or power supply?