You're new iMac is way too new to be experiencing a shutdown issue like this. However, anything is possible.
Unfortunately, your Mac is now just outside of the Apple 14-day return policy, so we will need to try to figure out what the issue may be that is causing this.
First, I suggest that you unplug the Mac from the power strip and plug it into a wall outlet directly. With that done, power it back up. Can it power up to the macOS desktop being displayed on the screen?
- If it does, then we can continue troubleshooting.
- If it does not, then power it back down, and then, make a Genius Bar appointment at your local Apple Store to have it looked at. Alternately, you can contact Apple Support directly for assistance. To do so, simply select the "Support" link on the lower left-hand side of this forum's web page.
Should it power-up successfully to the macOS desktop, I would suggest that you run an EtreCheck report, and optionally, post it here if you need assistance with interpreting its results. EtreCheck is a free diagnostics tool, developed by a valued forum member, that greatly aides it troubleshooting difficult Mac issues.
Ref: Using EtreCheck to Troubleshoot Potential… - Apple Community