In the scene in the first Matrix movie where Neo is operating a Gatling gun firing at the agents through a window, they return fire. Since the agents are pure code in the Matrix and they know Neo's exact location down to the XYZ coordinates, why can't Agent Smith hit him? Neo isn't moving at all, he's just behind the gun - not pulling any of those sick bullet dodging moves.
For the record, Smith does manage to get off a shot at him, but misses by a few inches, well within the normal range of movement for a hovering helicopter. A few seconds later he's pelted with bullets and 'dies'.
As to the question of why Agents don't have perfect aim, that's largely explained by Morpheus' speech about their skills being rooted in a "world based on rules", one of which is evidently that Agents might well be superhuman, but they're not infallible.
The Screenplay describes the scene thusly, note the extreme confusion caused by the hailstorm of bullets, water and broken glass.
But Neo is too close, the .50 caliber too fast and bullets are everywhere, perforating the room.
Agent Jones is hit first, his body jack-knifing back, blood arcing out with a sudden flash of light--
Then Agent Brown, his gun still firing as his body falls. And finally Agent Smith.
Neo stares at Morpheus, trying to will him into action.