Diagnosis
'Setup Failed' is a catch-all for communication problems during the Bluetooth handshake between your iPhone and the HomePod. It's almost always a settings issue on your phone.
How to Fix It
First, force quit the Home app on your iPhone. Then, go to Settings > General > Transfer or Reset iPhone > Reset > Reset Network Settings. This clears your Wi-Fi and Bluetooth caches. You'll have to rejoin your Wi-Fi network afterward. Then, place your iPhone right next to the HomePod Mini and try setup again.
If That Didn't Work
Make sure you're signed into iCloud on your iPhone with the same Apple ID you want to use for the HomePod. Also, check that two-factor authentication is enabled for that Apple ID—it's required. Temporarily disable any VPN on your iPhone during setup.
Heads Up
If you have a custom or restrictive firewall on your home network (like in some advanced router setups), it might be blocking the ports the HomePod needs to communicate with Apple's servers. You may need to adjust those settings.