Your post strikes a chord with me OP :)
I've noticed a tendency for DS to say some things that, in an older child/ adults, would be sexist generalisations, and it's quite a moment to hear statements that don't fit with your own home coming out of your child's mouth!
It's happened quite a few times with DS over the years, from 3yrs when he started nursery to now, at 6yrs. From my own experience/ observations, I think it's a combination of cultural immersion and DS's own desire to make sense of the world.
Sadly, even from a young age they are surrounded by culture, and our culture does indeed have many (subtle and loud) messages about gender, class, race, sexuality, body image etc etc
It's shocking how easily even strong family teaching and values gets ejected in favour of sexist stuff like... (DS age 4: Dont be silly mummy, boys can't play with girls, 'girls don't play, they just sit and talk about purple bracelets and butterflies' (observation sadly, and turns out someone had been letting him watch adverts...).
Makes me realise again and again that you cannot get complacent, and messages have to be taught again and again, as they grow, and they need our help to connect our values and their observations or other people's commentary eg girls and boys are exactly the same... Except at DS school no girls are in construction club, so he needs help to make sense of that.
And lastly, the rule seeking! DS loves to make sense of the world around him by seeing something then trying it out as a 'rule'. I find it fascinating, as his world becomes bigger and wider. It's like watching a proto scientist, or ethnographer at work in a new world :) I also see it gives him a sense of comfort that the world makes sense, even though some of the rules he's trying out in his head don't exactly work for me!
Eg Rob is always naughty... So it's robs fault all the time (when Rob has got SNs and isn't actually being naughty)
Or girls are always good etc.
It helps to challenge or confirm those 'rules' he sees, and look for examples to show its not quite right when his rule is one I don't want sticking around!