To some extent, I think this applies to all differences between people and the mechanism by which someone comes to be perceived as threatening, disgusting, or just “other” in a more vaguely unpleasant way.
It’s just so jarring for people when someone who they thought was more or less “one of them” turns around and says or does something that runs so counter to the things they assumed were part of the in-group’s core beliefs that they then have to lash out even harder than they would have against this sort of “other” than one who was never part of the group to begin with. Because as you said, the existence of this kind of person threatens their own sense of identity, and some sort of intense, sudden action is then required to alleviate that cognitive dissonance felt by members of the in-group.