I've noticed that there are several fiction stories - in books, movies, or games - that depict AI takeover scenarios where the reasons why the AIs attempt a takeover seem at least somewhat plausible. It's just the details of the execution that typically make little sense, often including the part about how humans manage to save the day in the end.
Here are some that immediately jump to mind, but I'm pretty sure I've seen quite a few of these. I'm not going to elaborate on the details here because at least for some of these that would constitute major spoilers.
Movies:
- Terminator series (Skynet)
- Avengers: Age of Ultron
Games:
- Horizon: Zero Dawn