"gangs of idiots" smashed the prototype looms because they knew they would put them out of work. And they were right, even though the machines were probably a net benefit for society in the end.
It will be the same with AI. If it ends up actually benefiting humanity as a whole, it will 100% be a side effect of a few assholes getting insanely rich, or from massive governmental regulation.