macOS High Sierra restarting by itself during sleep
You can find the last shutdown cause by examining the logs. Run this command to filter the logs for shutdown causes:

log show --predicate 'eventMessage contains "Previous shutdown cause"' --last 24h


You can then lookup the shutdown cause code in this table: macOS Shutdown Causes.