It's possible to throw weapons through walls, closed chests, braziers, vending machines, closed gates,... as long as you have vision on the target. When the projectile supposedly collides with the terrain, the sprite disappears, but the monster is still hit and takes damage. This seems to work 100% of the time. Doesn't work on projectiles that proc on-hit effects, such as Concussion Bomb and Acid Flask (the on-hit effect is applied on the colliding terrain, and the monster does not get hit or take damage). Doesn't work on bolts, either.
This is another one of those bugs that was around back when dinosaurs walked the dungeon (without being supplied by a mod). More fun is throwing at a monster several ranks back in a zoo. You'll hit the one you aim for as well as the poor sap who actually gets struck by the projectile. EFFICIENCY!
I always thought that what ha-pened was that the projectile's base damage hit the one you were aiming for and it's special effect, if any, hit the creature that was in the way. My experience is that throwing through walls works differently from throwing through blockers. You don't need line of sight, the animation for the projectile may continue past the first square of the wall and you may be able to throw the projectile all the way to the other side.
Originally the thrown projectiles worked like bolts, stopping at the first obstacle of whatever sort. Then, someone said they ought to "fly over stuff" because it's possible to lob a bomb over an obstacle. Thus, they now do. But with what you described, it is not working the way it is supposed to. So yes, it is a bug.