You’re probably right. Shakespeare was also a great student of human nature as well.
Yet even he occasionally picked up on unfair stereotypes (as in the Merchant of Venice — it’s unlikely his Jewish contemporaries were really as crass as Shylock).
Some folks still debate whether Shakespeare was even Shakespeare. With no computer he would have been one very incredibly busy bard with his quill pen. At least once he even stuck a musical score in! (As You Like It, I think. I remember trying to read and arrange the sloppily scrawled thing, on a crazy irregular staff, and then a couple years later I was surprised to independently hear it performed on an educational TV channel.) But it might have been sheer brute force talent.