I have a late 2013 27" iMac running Yosemite, and it randomly shuts off every now and then. I tried everything Reset SMC. Diagnostics, reformat Macintosh HD but still occurs and running out of options.
In general shutdown cause -62 means:
Watchdog timer detected unresponsive application, restarting the system.
So you're advised to troubleshoot your system for any stuck application, startup item and any loading preferences. So try to clean up your system, or reinstalling macOS also may help.
Remove externals for now and do a Safe Boot. See Apple Support page on Kernel Panics for more info, procedures.