Don't forget that they do not have auto-aiming for their phasers and despite their advanced photonic torpedos, these are usually not homing either. (It might be that the Defiant's phasers, which were shooting these bolts instead of the continuous beams, were auto-aimed)
(Don't get me wrong, I absolutely loved Star Trek. TNG and DS9 in particular).
In my headcanon, the somewhat low accuracy of weaponry in Star Trek even at close range is explained by ridiculous amounts of trek-tech electronic warfare going on. Every ship emits enough jamming, sensor ghosts, fake warp fields, whatnot, to keep enemies' computers busy trying to make sense of it. At long range you're guaranteed to not hit anything, so ships have to fight pretty close - which explains the ranges we see on-screen.
Their torpedoes don't even have to be "homing." It should be possible for them to have onboard AIs smart enough to allow them to develop complex strategies, use swarming tactics, evasion, etc.