TV’s generally can receive Airplay 2 not transmit it.
So your iPhone would see the Sonos speakers and the TV as being Airplay speakers, but the TV would not be able to play audio through the Sonos speakers.
Apple TV can transmit to Airplay speakers, but I have never seen a TV that can transmit Airplay.
I tried to run some play ones as Mac speakers for a while and it was not a great experience, lip sync is an issue and the Mac would disable Airplay if not used for a few minutes and I kept having to re-enable it.
I sold the ones and bought a Beam to use via optical instead and it works better with the Mac, but not without its quirks.