Maybe my initial interpretation of it was wrong.
I checked the scripting, it
looks like the code is "if this sim hasn't learned that this sim has a trait, and the trait can be learned randomly, ensure that it is learned". So if a Sim has the Night Owl trait, and another Sim learns a trait from them, it will be the Night Owl trait that is learned. Which doesn't really make sense at all - unless it's 2AM, surely more obvious traits, like Athletic or Genius, would be learned - the sim is more muscly, or speaks a mile a minute in jargon. Or even Snob or Diva. Or just Absent-Minded.
In turn, it also looks like this is only applied to celebrities, so only if the Sim who has the trait being learned is a celebrity, will this happen.
All in all, the scripting is now confusing me.