Diagnosis
This points to a Wi-Fi network incompatibility, often with certain mesh systems or routers using band steering or aggressive power-saving modes.
How to Fix It
In your router settings, try disabling band steering (sometimes called "Smart Connect") to force separation of 2.4GHz and 5GHz networks. Set the HomePod to connect to the 5GHz network specifically, as it's more stable for this device.
If That Didn't Work
Assign a static IP address to the HomePod in your router's DHCP settings. Also, ensure your router's firmware is updated. As a test, create a simple hotspot with your iPhone and set up the HomePod on it. If it stays stable, the problem is definitively your home network.
Heads Up
The HomePod 2 does not support Wi-Fi 6E, only Wi-Fi 6 and earlier. If you have a 6GHz-only network, it won't connect. Also, it needs a standard password-protected network; it cannot join enterprise or captive portal networks.