Thank you. That helps.
First verify that nothing is misconfigured in the power and sleep settings.
Then I would open the event logs and look for some application or process that is running just before the computer turns off. Maybe a default setting after a backup, AV scan, or some update scheduled for the wee hours.
Maybe you did not set up that shut down per se but some update or reinstall may have done so. Seems as if more and more applications take the liberty of making such changes or otherwise override existing user settings. Usually done for the sake of "security" or "user experience"......
Also strange that, if you are on and working, that you do not get an opportunity to override the shutdown.
Another, more paranoid, thing to try is to be off line and off your home network during a morning or two. See if the shutdown happens. That will at least narrow the problem down to the computer and installed applications.