After Serial.end() has been called (e.g. during a custom shutdown procedure), ESP.restart() will not trigger a hardware reset anymore. The ESP32 just sits there doing nothing. It does seem to go into deep sleep though, because it stops drawing power significantly and cools down pretty quickly.