Archived from an old comment of mine. This link is unfortunately missing the second half of the comment which was added later.
spoiler
That one appearance of [Bashir’s] parents exposed so much of his being that everything up to that point just immediately made sense.
Look at the way his family treated him, even as an adult. They never cared about him at all. They just wanted a success that they could show off as their legacy.
Imagine growing up with parents who are so incapable of showing you their love that they have illegal genetic manipulation performed on you, just so that you’ll be intelligent and skilled enough to be worthy of their approval.
His entire upbringing was that you have to have those qualities to be liked and appreciated as a human being. And even then, it still wasn’t good enough.
Then he entered Starfleet academy, where it’s again (mostly) the same story. Only the best and the brightest graduate from the academy as officers.
I’m sure he’s had plenty of peers up to that point. But with the unreasonable expectations his parents put on him throughout his adolescence just to get their approval as a son, there is very little possibility that he ever had time or opportunity for real friends and the type of human connection that having them would bring.
This seems less “eccentric scientist” to me and more just arrested development and pure naivety. His entire existence up to that point had been “show people what you know and what you can do, and they’ll like you! That’s all that matters!”
Yes, he does compensate a bit by handicapping himself (like when he purposefully got one question wrong on his final exam). But even so, nothing about his earlier appearances scream humbleness or humility.
Remember when he was driving Chief O’Brien up the wall early on? It’s a perfect example of it. “Oh, you like racquetball? Me too! Let me show you how amazing I am! Then we can be friends, right? Everything is a friendly competition!”
That doesn’t seem like overcompensating to hide his past. If anything, he just comes off as a total showoff (albeit a bright-eyed and bushy-tailed one).
It’s not until time passes at DS9 that he begins to realize that he doesn’t need to do this. He learns what it’s like to have real, human experiences and connections that aren’t predicated on how smart or skilled you are. It’s his first opportunity in the real world to just be himself (let alone discover who that really is to begin with) and have actual friends who accept him.
Once he goes through that transformation, he mellows out quite a bit into a much more well-rounded person. Yes, he’s still an over-achiever, but with much less hubris and with much more humility.