I have run into the same problem with the same error (gaierror) and I found out what I have messed up with my HA. I am running HA in docker container on an UBUNTU and recently I started experimenting with docker installation Pi-Hole or AdGuard (on the same server) but it turned out it is not useful to me as I can not use for DNSoverHTTPS encryption (complicated). I started to experiment with my linux networking settings that I am not completely understand. Days later I realized that I am not getting phone notifications from HA (same error in my logbook). It turned out after lot of reinstalling and debugging that the problem was my UBUNTU network setting and reset of networking setting solved my issue that I had been trying to make it work for days.
Here is the commend that i used on my linux server: sudo iptables -F