I've had similar a few times. The most illogical was had a sales person (female) telling me (male) about how girls cant get ahead in the company, naturally in context to themselves.
I asked them what their boss was (female) and their bosses boss (female) and til a few months before, their bosses bosses boss (was female and recently changed to male). Was not a happy look I received.
And 100% there is sexism/racism in workplaces but in my small bubble of the world it feels a reasonable proportion of people put these kind of excuses on their lack of progression over looking inward, but I've tended to work in more progressive environments so maybe I've missed what the wider world is like.