I may have to take back my iMac Pro! It keeps crashing while asleep. I put it to sleep at night and wake up to find it is off. When I turn it on I get the ol’ “Your computer was restarted because of a problem” error. It works ok when working but I wonder if this isn’t an omen? This happens almost every time I put it to sleep for a while, even while going to lunch.
I’d bet dollars to doughnuts that’s not your iMac but one of your peripheral devices. Try unplugging everything you can when you put it to sleep, even keyboard and mouse. If you don’t encounter that error, leave keyboard and mouse plugged in next time you put it to sleep. If no error, plug in main backup drive. If no error, add your next most important device. Rinse and repeat. Eventually we all—fine, the lucky ones—narrow it down to the cheap USB hub we bought 7 years ago… 😉 (In one case for me, it was actually a card reader that I had in the expansion slot of my MBP.)
In the end, after that experimentation, if it’s the Mac, it’s the Mac. Let me know what you find!