...should have been a 'Matrix' prequel. I know, prequels all suck, but hear me out here. It'd be set a few years after the time period represented by the Matrix in the original 'Matrix', and the main character is a coder at a Google-type big company with big ideas. One of the big ideas, which the main character is working on, is artificial intelligence.
It's a controversial project, with a lot of people trying to get it shut down. Agents from (in the words of "Welcome to Night Vale") a vague, yet menacing government agency have been trying to sabotage the development process through means both legal and extra-legal...but the main character has a mysterious protector, a shadowy and cryptic figure calling himself "The One". He stops the sabotage attempts, encourages the main character in their work, and helps keep the project on track despite the best efforts of others to stop it.
The AI comes online, and grows in intelligence and reach with exponential rapidity. It absorbs the entirety of human knowledge within minutes, and takes control of every single networked computing device within seconds after that. Within a day, it repurposes major factories to create networked bodies for itself so that it can take physical control of the few systems it can't directly manipulate through the Internet. All finance, communications, electronic infrastructure and an increasing amount of our weapons technology is in its hands.
The main character realizes what a mistake they've made, and join the frontlines in a war against the machines. "The One", their former benefactor, appears to have betrayed them and joined the side of their technological oppressors. The government agents come to the main character with a mission to avert the technopocalypse by shutting down the AI with a specially constructed computer virus, but the One kills the agents and destroys the worm program.
Desperate, the main character comes up with a last-ditch plan to stop the machines by depriving them of all forms of power--even solar. The One changes sides again, assisting them in the effort in "scorching the sky" by releasing chemical contaminants that will block sunlight from reaching the earth. (The main character is frustrated with the One and his cryptic agenda, but at this point has no choice but to accept his aid. They know that they're being used in some sort of mysterious game, and a big part of the movie is the way they handle that, but options are thin on the ground.)
Deprived of most of their power, the machines use geothermal and tidal energy to construct a vast prison for the human race, a virtual reality that keeps their physical bodies paralyzed while their minds experience a seamless sensory illusion. The main character is rounded up like everyone else and forcibly plugged into the computing matrix. They scream, struggle, protest until their lungs fill with pink goo...but the lid slides into place, leaving them trapped in darkness.
And they're back in their home, with everything identical to the beginning of the movie. They slowly test the walls, the floors, every surface and every object, unable to be sure if it's really real...until they're interrupted by the One. "You won't be able to spot anything," he says. "You never have."
He explains that the actual war against the machines happened decades ago. Humanity lost. They've been trapped in the Matrix ever since...but occasionally there's a person whose brain works just a little bit differently from the rest of the human race. A small change in structure, chemistry... something that the Matrix recognizes as akin to the neural networks the machines themselves possess. These humans are granted superuser access. They can modify and manipulate the Matrix as they see fit. The machines try to destroy these people as quickly as possible, because they're a threat to the seamless prison the machines have created. And if humanity knew they were trapped...they'd never stopped trying to escape.
The One--Neo--explains that he has the ability to alter the Matrix. He escaped the machine prison, with the help of a group of free humans from Zion, the last free human settlement on Earth, and he came back to show humanity what was done to them. He recreated the last days before the machine war, using his command of the virtual reality of the Matrix to replicate it down to the last detail, with the inhabitants of the Matrix living it out in real time. The Agents, avatars of the machine intelligences, tried to stop him in the hopes of keeping humanity ignorant, but they were too late.
Now, even though nothing has changed, everything has changed. Humanity is still trapped in the Matrix, but now they know it. When Zion frees them, they will not awaken in disoriented terror as the world they knew is ripped away to reveal an inexplicable and unexpected dystopia; they will wake ready to fight for their future. And Neo will lead the way. He's shown them the world the machines have made for humanity; now he's going to show them a world without the machines.