Your window to return unwanted items is usually fairly limited and terms of sale vary. Apple should replace in warranty items that don't work as designed, however if Apple have denied that claim then I suspect they work if set up correctly. If you are unable to make them work with your Wi-Fi equipment you could argue that they are not fit for purpose, but I don't know what recourse that gives you in your region.
What happens when you try to set one of them up? Presumably you've followed advice such as that in If you can’t set up HomePod - Apple Support. Is your Wi-Fi set up with WPA/WPA2 and with any client isolation feature turned off?
Note that:
- HomePod doesn't support public or subscription networks with sign-in requirements. These networks are often in places such as businesses, schools, dorms, apartments, hotels and shops.
tt2