I think it’d be subverting expectations. From the start you might think it’s about the Pacific trash island that has collected there, but then it turns the other way and calls Puerto Rico a trash island. A decently funny joke imo, even if rude. I’ve seen the same joke being done about the UK and it did get a proper chuckle out of me.
The main difference is that the UK used to be powerful and did a lot of bad things to a lot of countries around the world. Puerto Rico on the other hand has always been weak so it feels weird for someone in a much more powerful area of the world to pick on them.
I don’t think how places used to be plays any part in how funny insulting them is. Despite being as powerful as the UK when it was last relevant and worse, I think people would still be offended if he said Japan instead. “Always OK to hate colonizers” as someone put it my butt, the internet just really wants to make fun of France and not feel bad about it.
I would say it is fair to make fun of them as long as they themselves still glorify that past.
Good comedy can punch up, but very rarely works when punching down. Punching down is generally just bullying in disguise.
I think Anthony Jeselnik sums it up pretty well