I read it like 'Lets take the worst possible context of these phrases and MAKE them racist/sexist/other-ist's.'
The "I never would have guessed you were a scientist" to a woman, in almost every realistic case I can fathom, would have nothing to do with her (or even his) gender, but likely her/his personality or behavior.
Like if I ran into a person (man or woman) say at the gym, and they were supper funny and goofy and outgoing, then later revealed to be a scientist, I would say just that. "Wow I wouldn't have guessed! You're such an extrovert! Fascinating!"
It doesn't NEED to be about gender, but I feel they force it.
Basically context.