iMac randomly switching off
I have a 2017 5k 27" iMac. Recently it has been switching off and powered down when I come back to it on occasion. Normally it would just wake out of sleep.
Today working on it it just went blank and switched off whilst I was typing also accompanied by a buzz (very similar to an iPhone set on vibrate). I could not switch it on again but if i turned it off at the mains and wait about 3-5 minutes it will switch back on. It then switched off again about 3 minutes later.
I've now left it for about 10 minutes with the mains switched off at the plug, turned on the power and it came back on as normal with the accompanying apple tone. As I entered my password it started to login and then just switched off again. I am now back in and all the screens I did have open are there.
I'm baffled - any advice?
There is no sign of any overheating and no error messages come up when switched back on.
MacOS Big Sur v 11.5.2
iMac 27″ 5K, macOS 11.5