NPCs don't realize there is a wall between them and the target so their shots hit the wall instead.
Not clear why monsters don't do the same.
https://youtu.be/ERhdkfdkmUg