The first two should have that result. Once HA is restarted the message should be replaced by a series of messages indicating it’s restarting.
That shouldn’t happen when just flashing ESP boards. However, I’ve found my RPi 3 B+ really struggles to compile and re-push the ESPHome firmware to the devices. It’s very possible you’re running out of some resource and crashing HA. That would cause the symptom you’re seeing.
I just recently disabled the ESPHome add-on, and I do my compiles from my laptop using the ESPHome command line. I can always start the ESPHome add-on if I find I need it, but to be honest I haven’t looked at it in months. The ESPHome integration works fine without the add-on running.
When I first started my HA journey years ago (read: my setup was still quite small/light, no other add-ons, etc.) and was using a 3B+, one of the first things I did was check out ESPHome. I spent forever trying to get it to compile a basic YAML file thinking I was doing something wrong, before I realized it just simply couldn’t do it without crashing. At the time I switched to using my PC for compiling (although I’ve since switched to better hardware for HA and use it now).