Modern weapons can be very accurate, as long as they work...which isn't all the time.
Firstly that artillery shell analogy is a really bad one to use...fire an old style shell and as long as the gun is pointed in the right direction and the right charge is used off the shell goes in a parabola towards the target...nothing for it to do in flight, no moving parts needed to control the flight path.
Modern weapons guided weapons they are much more complicated than that, they actively have to be able to control their route/flight path so they are quite complex and it doesn't take much to go wrong with the workings such as a failed electronic component, hydraulic or mechanical parts breaking and they become completely dumb ..and then off they go, who knows where?
I'm sort of guessing here but a failure rate of maybe 1% overall these days is possibly as good as it gets with NATO kit. Given the Russians have fired hundreds of some types of missiles, and they probably have a higher failure rate than NATO that means there is a good chances a few of those have gone "rogue".