This problem bugged me for a long time. I could list the contents of the Plex library in the Sonos app but whenever I tried to play a file, it errored with Unable to play – Unable to connect to Plex. It just doesn’t work.
The solution is NAT – specifically NAT reflection. You must enable Remote Access on your Plex and you must forward the port (usually TCP 32400) on your router. It is, however, a bit more complex than that. You also must be able to access Plex, on the public IP and port, from inside your network. This is called NAT reflection. For example, if your public IP were 220.127.116.11, you need to be able to access http://18.104.22.168:32400/web/ from a computer inside your network.
I will not attempt to try to describe how to enable NAT reflection on every router. I would imagine that some routers simply don’t support it at all.
In my case, I use pfSense. In pfSense, edit the port forward NAT rule and “Enable (Pure NAT)” for the NAT reflection setting. If this doesn’t work, as it doesn’t in my case, select Enable (NAT + Proxy) instead.
Make sure you can access http://22.214.171.124:32400/web/ in your web browser, where 126.96.36.199 is your public IP. If you can, Sonos should work fine with Plex.