I doubt this is a bug, not everything can be ranged or maged over, that’s just how it is. I don’t think there’s an exact reason why you can range over some things, but not others but whatever.RuneScape Gold.
If you want to safespot monsters your best bet is to find a narrow space they can’t walk through. For example Hill Giants take up 2 or 3 squares, there you can stand to the side of an obstacle so you are not behind it, causing your player to run around when you attack the monster but so you are just trapping the monster on the corner of it, because the monster is too big. RuneScape 2007 Gold.
Now this won’t work with monsters that only take up one square, in which case if you really need it you can try to trap the monster behind something and range over it, but like I said this is not possible everywhere, even if it seems like it should be possible. RS 2007 Gold.
Also some abilities may make you run out and try to hit the monster up-close, I don’t know which ones exactly, and I’m not sure if that has been fixed so if you find it happening when you use a certain ability, try switching the ability out for something else.