This is a bug that persisted since Warhammer 2. No mods, latest version.
If a unit docked on the wall can fire in all directions (e.g. Black Ark Corsair Handbows or Shadow Warriors), it will also be able to fire through walls and other obstacles.
Way to reproduce:
1. Take a unit of Shadow Warriors and a random small lord/hero of opposing team.
2. Place the SWs on the wall near the gate.
3. Place the enemy lord in the gateway where he normally wouldn't be able to get shot.
4. SWs will shoot through the wall and through the gateway, dealing damage to the lord trying to break down the gate.
I can provide screenshots if the dev team needs a better explanation.