I have this issue: new iMac 24" M1, just updated to latest Big Sur 11.5; 3 HomePods, just updated to latest 14.7. iPhone / iPad play fine to HomePods.
iMac / Apple Music has had all the issues described here.
Seems related to the iMac going to sleep - before this, it works fine from within Music app (Airplay icon, select one or more HomePods) or from Control Centre. After Sleep, plays for 5 secs, then sound stops.
Force Quite AirPlayXPCHelper and quit / re-open Music, and it now works again.
Send iMac to sleep, wake it up, problem is back.
It's not an issue on my Intel MacBook Pro, so I think it is categorically an M1 chip mac issue, given people on this and other threads are having issues with M1 Mini / MacBook and iMac.
Maybe Monterey will solve it. I've toyed with re-installing Big Sur OS, but haven't gone that far yet - interested if any others have solved through this method.