If I'm reading this correctly, it sounds like they are not registering that there's a wall between them and the enemy.
If that is indeed the case, then rest assured it happens to me, too. They'll stand there, firing away at a closed door forever, unless you open the door. Quite often they'll attempt to shoot through the walls, too. Tends to help if you tell them to move a bit, though, then they'll usually find a spot to fire from.
But yeah, point was, it's obviously not supposed to do it, but it happens.