Since you are including works of fiction, I think Terminator (1984) is worth mentioning. This is what most people think of when it comes to AI risk.
By the way, my personal favorite, when it comes to AI doing what it wasn’t intended to, would have to be Eagle Eye (2008) . It’s got everything: hard take-off and wireheading of sorts, second-guessing humans, decent acting.
The embedded YouTube video seems to end rather abruptly. Did the iPhone battery run out?