I have largely solved the problem which I explain below, but I thought it might be helpful to others if I wrote it up.
I have Roon core installed on a NUC7i3BNH running Ubuntu 20.04.
I recently acquired a second-hand Sonos Play:5 speaker (first generation) to add to my audio system. Set-up using the Sonos 1 app and linking the speaker into my home network went smoothly, and Roon immediately recognised the Sonos speaker as an audio output. I successfully updated the Sonos firmware. However, a problem arose when I tried to play music from Roon through the speaker. After 30 seconds, playback would stop and the Roon controller would display a message that Roon had lost control of the speaker. Pressing the play button on the Roon controller would restart the music, but after 30 seconds the same thing would happen. In all other respects the Sonos speaker seemed to behave normally - it could for example play radio, and tracks from Idagio. It would even play music from Roon over an audio cable from the NUC to the line-in jack on the speaker. It just wouldn’t play from Roon over my network, either wired or wireless.
I traced the problem to the Ubuntu firewall (ufw) on the NUC. I had already configured the firewall to leave open the recommended ports which Roon needs to communicate with other devices. When I disabled the firewall, the problem with Roon playback on the Sonos disappeared, and playback was normal. I tried but failed to find any good information about other ports which needed to be open for the Sonos speaker and the Roon core to communicate properly. So I created a DHCP reservation on my router to give the Sonos speaker a non-changing IP address, and created a new rule in the NUC firewall to allow all access from that address. Problem solved. Playback in the speaker from Roon now normal.
However, allowing all access from a given IP address is not great from a security point of view. It would be better to allow access on specified ports, but as I have already said, I could find no information about which ports these might be. Someone in either Roon or Sonos should be able to throw light on this problem, and it would be good to hear from them.
The sound quality on the Sonos Play:5 is magnificent, by the way!