So this has been an issue literally since I started playing ADOM, and it's one that's fairly minor so I've just learned to work around it, but it is indeed a bug that should probably be fixed. Please look at the screenshots I attached, they're fairly important to understand the issue:
In a lot of situations, if you're aiming at a monster itself (to shoot it, for example), the path of the aiming goes through walls in order to hit the monster, and actually shooting will just hit a wall. (See image 1)
Instead, you need to actually aim past the monster in order to hit it. (see image 2)
This is an easy workaround, but it's klunky and buggy and easily fixed, so it seems like a good improvement to make.
Also closely related: the paths are not symmetric.
For example in following layout you'll be able to shoot the enemy but the enemy won't be able to shoot you.
Code:
#.k
##..
@...
####
Your missile will take first "step" right and rest diagonally but the monster's missile will take first step left and rest diagonally, thus hitting the wall.