UPnP uses "bonjour" networking which is TCP/UDP multicasted on the source (first) subnet. If the RPi is behind a NAT gateway the multicast traffic is blocked so devices in a second subnet (behind the gateway) will not be able to see bonjour devices in the first. The router is handling normal TCP/IP traffic so Samba shares etc. can be reached.
I typically see this when people have an internet router and then use a second router to extend wireless into another part of the house. The second router creates a second subnet with NAT on the 'WAN' interface. Despite 'double NAT' it will work for internet access, but devices in the second subnet cannot see broadcast data from the first. In this scenario the easiest fix is to configure the 'router' to be a 'bridge' interface to the original network and not actually route. Most routers support this; it's just not the default option.