This is the sort of issues that some kind of "unconscious bias" training should help you overcome. It is really frustrating for the victim but those who are perpetuating are not racists or evil. It is a social mental conditioning that they will overcome if they realize how much damage they are doing.
My wife joined an ecomm company recently. Since entire joining was remote, it was little hard for her to get onboarded with the team and her manager would assign her documentation and testing issues. Few weeks later when she told her manager that she would like to write some real code he was surprised. Because of her gender he had thought she was a tester.