"Who is she? The cat's mother?"
I don't know how common the above phrase is outside the UK, so I shall explain its meaning: it is a rebuke used to children who refer to a woman (often their mother) as "she" in their presence. It is general truth that referring to people by traits rather than by identity is considered impolite. Referring to someone as "elf" is removing their identity, and instead substituting a group trait, and so it will very likely be considered rude regardless of any wider context.
A polite character could prefer "good sir", "m'lady", or "my good man", etc whilst a less formal character could prefer something like "mate", "chum", "duck", "love", or "my lover", etc.
Is shouting "racist!" correct or helpful?
Not really, quite apart from @ThomasMarkov's excellent frame challenge above, it should be understood that the concept of "race" in D&D (or the writings of Tolkien and others) is not the same thing as race in the modern world and conflating the two is unhelpful and disruptive to the game. Dividing humans into races is ascientific tosh, no more meaningful than dividing people into blue eyed or not, but an Elf and a Human are as different as a horse and a donkey.