The 27" iMac has user accessible RAM modules. It may be that one of them is failing.
Install memory in an iMac: https://support.apple.com/en-us/HT201191#2
I would remove all of the RAM modules that are installed in the iMac.
Then I would replace them all back, making sure they are seated snug and proper, and try to restart the iMac.
If the iMac still fails to restart, then I would remove the RAM again but this time reinstall them, one at a time, and try to restart the computer after each. If you can get the iMac to restart with a single module in it then you're making progress. Of course some iMacs won't restart with only a single module in place so that could be a factor here.
Also, since you can't get the specific year info from the iMac itself, you might visit everymac.com at this website: https://everymac.com/ultimate-mac-lookup/
There you can type in the serial number found on the bottom of the iMac and look up exactly which machine it is.