That is by far the most likely scenario. Hell it’s already happening with the AI we do have. Teslas driving into walls, facial recognition mistaking an innocent person for a criminal (mentioned in the article).
Doomsday science fiction is fun to toy with but it usually involves a lot of hand waving.