The far more common scenario in the dot-bomb era was that you lost your job (which almost certainly wasn't paying the kind of salary many developers expect today), were left with a pile of worthless stock options, and maybe spent a couple years asking people if they'd like fries with that. (That's only a slight exaggeration. I was very very lucky to almost immediately land another position--which then went through its own rough times but not to the point of being unemployed.)
Some people made out of course, but in general ~2001-2004 was not a great time to be in tech.
For this specifically, Musk was so immature and inexperienced that he was either kept away or removed from higher posts, but since the ideas themselves materialized and were successful (see Zip2. X dot com), he walked away with millions. He was the definition of failing upwards. And once you have 200 bars of walkaway money, it's really, really hard to fail.
Per Wikipedia: "Within the merged company [PayPal], Musk returned as CEO. Musk's preference for Microsoft software over Linux created a rift in the company and caused Thiel to resign. Due to resulting technological issues and lack of a cohesive business model, the board ousted Musk and replaced him with Thiel in September 2000."
Maybe you could have timed the bubble and exited with a pile of cash, who knows. If you want to make those kinds of bets you could make them right now.