I have a Lutron Pico remote that I use to control my Sonos speakers. It works fine with any audio source except Roon.
With Roon, the play/pause button skips the current track the first time it is pressed and plays the next track. Pressing it a second time pauses the audio.
I tried doing what you describe a long time ago. I never got it working correctly. As you wrote, it works fine with other sources because, in those other cases, Lutron is controlling Sonos and Sonos is managing the content (Spotify, Apple Music, etc.). In the case of Roon, Roon is controlling Sonos and the two systems don’t really collaborate.
The solution for me was to move to Home Assistant with the Lutron and Roon integrations. Buttons on a Pico remote can be Home Assistant automation triggers. Automations, including managing transport and volume on Roon devices, can be automated in response to those triggers. This approach is quite a bit more work than what you’re doing now but it does work much better for me.