I have a Mac, iPhone, and HomePods and Handoff works on all devices. Playing Apple Music on iPhone shows the song on my Mac in Apple Music and I can switch songs there and I can hold the iPhone next to the HomePods and the song will continue to play on the HomePods. When HomePods are playing, I can switch songs with my Mac or iPhone and holding iPhone next to HomePods will transfer the music back to playing on iPhone. My setup is as follows:
- Same Apple ID
- Bluetooth on
- Connected to same Wifi network
- Mac and iPhone have Handoff turned on
- AirPlay is also on
Not sure if all are required, that is just how mine is set up. Maybe others can chime in with their observations. I am aware of past reports of Apple Music not working correctly between devices, but that has not been my experience.