In the Matrix trilogy the city of Zion and the rest of the 'real world' aren't real. They're another illusion created by the forces behind the matrix (about whom very little can be speculated since given this headcanon the zionites have been misled [and the Oracle and Architect weren;t trustworthy sources of information to begin with]. We don;t know if they're even really machines, {or even really hostile, for all we know The Matrix could actually take place in the world of Total Recall}. Presumably the Oracle and Architect are machines but we don't know if they speak or even knpw the truth).

It's one of only two possible interpretations that make the movie make sense (the other being that contrary to its hard sci-fi exterior the Matrix trilogy is actually in something closer to a science-fantasy setting like Star Wars or Star Trek where people who have magic powers are a thing that exists; I'll be covering this other possible explanation in parenthetical notes).

There's extensive evidence that things in the setting are not as they appear.

First and foremost is the alleged purpose of the Matrix. It's clear that Morpheus has been deceived on this point. The Matrix alone would use far more power than could be generated by that power plant just from human body heat, and there certainly wouldn't be any left over to power anything else (unless they were actually harvesting magic, rather than heat or electricity). It's more plausible that the idea of this body heat power plant is just a false idea that has been fed to the zionites

Secondly, Neo's powers and to a lesser extent everyone else's powers. A couple issues with these.

Firstly, there's no more reason why realizing that there is no spoon should give you power over the spoon than there is reason that realizing that there is no BFG 9000 should give you power over the BFG 9000. Unless, of course, it was something built into the program to begin with. Idkfa.
(alternately in the science-fantasy interpretation this could be viewed as some kind of sympathetic magic)

Secondly, Neo's powers in particular make very little sense as he can use some of them outside of the matrix. He still has power over the machines while disconnected from any sensible link to them. Clearly this is still more of the narrative that's being fed to him. (or, alternately, he's telepathic)

The translation of injuries in the matrix to injuries out of the matrix makes sense only if things were deliberately and perniciously rigged for them to carry over. "The mind makes it real" doesn;t hold water; first and foremost because they know it's not, and secondly the materials are generally on hand to counteract both heart attacks from sudden fright and the physiological stress symptoms and behavioral disturbances associated with voodoo death,which takes upwards of 24 hours to work anyway. (alternately it's psychic powers and/or sympathetic magic). There are also the related issue of why suddenly disconnecting someone causes instant and unavoidabke death. While I can completely see how that could cause seizures, strokes, or any number or problems, none of them could cause the sort of instant death that is depicted.

There's also the issue of why people look the same in the matrix and in zion. The think about residual self image only makes sense if they've seen what they really look like.

Finally, during the climactic fight scene in Revolutions, Agent Smith taunts Neo, claiming that his "Freedom and truth" are "illusions" and "just as artificial as the Matrix itself"