maybe not. There could be mass unemployment and all the big dogs could also lose from the buildout while smaller players (non-public) take over. It could be a lycos / yahoo / google situation where there was no "winner" to invest in during the initial dotcom crash, and there was large-scale disruption all the same.
The dotcom crash has nothing to do with the AI build out
I'd like to note that "the sector which employs you" should be considered when talking about diversifying. (In general, not only when worried about the Robot Takeover.)
A long stretch of unemployment can be weathered by selling a bit from strong investments, and a crashing stock-market can be waited-out by staying firmly employed, but both simultaneously is what can force people to "sell low" just to pay regular expenses.