HomePod: Airplay might not work because my network does not support peer-to-peer connections
I was affected by this issue during the weekend and after some searches I found out that this the cause might be that a feature in your router called "IGMP Snooping" is disabled.
This feature is more associated with Switches, however most commercial/home routers these days are comprised of a router and a switch. Thus, this feature will likely be found under LAN settings.
In my case, I had to change routers because Google's Nest Wifi Routers do not allow setting this feature. I had to change into my travel GL-Inet AX3000.
This is an annoying issue because you won't be able to Airplay using your network, i.e. I don't always use my HomePods with my Apple TV, so I have them in a different "room" in Apple home even though both the Apple TV and Homepods are in the living room.
Apple TV 4K, tvOS 17