That is quite assuring that you don’t experience wifi dropouts (that is what that thread is/was about initial).
Your problem look like they are related to the api communication.
The thing you really need are logs (best from the esphome node(s) and ha). Only they will tell you what really happens and which side (ha or esphome) “drops” the connection - and in best case even tells you why
omg, I found my issue! For the longest time, I tried to figure out why my esp devices were dropping wifi constantly. Driving me nuts. The answer was always in front of my face whenever I stare at my router. Either the fuse box or the massive different cabling behind that wall is causing interference. I relocated my wifi portion to a different room and no more drop.
Jesus… i wonder that this thing worked at all! Wifi device must always be on open air, NEVER in the closet, NEVER near any cables, NEVER close to (brick) walls, NEVER close to another device, especially switch mode PSU…