There are lots of collective nouns for people that are now considered unacceptable, The one beginning with N is the most obvious, but there are many others.
Since the middle of the last century, so for 60/70 years, the word “gay” has been acceptable to describe people who are attracted to members of the same sex, although it’s mostly applied to men. It was used earlier, but mainly to describe people with a casual attitude to sexual behavior.
Most alternatives such as “queer”, “pansy” and “poofter” among many others are now considered pejorative, which leads me to wonder how “gay” has survived as acceptable.
As @Grrr states above, context is everything. Which words are or are not acceptable is (or at least should be) determined by the people to whom they apply. “Queer” has been fairly thoroughly reclaimed to the point where it’s now part of the “official” acronym, LGBTQIA+. There are a minority of (mostly older) folk who still strongly prefer not to have that label applied to them and a still-smaller minority who strongly object to the term being reclaimed at all, but on the whole the ship has sailed. Still, the term shouted in anger by an enemy has enormously different resonance than the term used endearingly by a friend or proudly self-applied - I’m sure you can think of some other examples.
I also wonder how “white” has survived as an acceptable term for people of European descent (but not too far south in Europe). I can’t imagine why anyone would want to be called “white,” because it sounds awful. Caspar the ghost is white, I’m not.
The language changes. I’m 73, and when I was about 12, “black” was still an offensive thing to call a “negro.” At that time, “African-American” would have baffled people. Here in central Indiana, “colored person” was the polite term.
When my congregation was interviewing for a new minister, one of the candidates self-identified as queer. We are a welcoming congregation, and had openly gay staff members before, but the word “queer” was too much for our mostly 65+ year old members to even utter.
Queer is somewhat contentious among some folks. I don’t mind referring to queer studies when talking about academics and Q is part of the ever growing alphabet soup of LGBTQ+, so there are people who refer to themselves as queer. But I would never casually refer to anyone as queer because it was a perjorative for so much of my life.
Edit: And I’m reminded that I need to read the replies before I post my own.
I remember a Monty Python sketch which had a weekly contest on what sort of derogatory term to call different groups. That week was the Belgians, and “sprouts” was put forward, but they finally settled on “those dirty Belgian bastards.”