any type of gun going off in apt can go through a wall and kill someone. Even a shotgun probably. Through a wall outside also happen. But through a wall, through another wall, probably with high powered handguns and rifles but i bet that is pretty rare.
You should though think about whats the best round and weapon for self defense if you dont want to go through a wall.
Still though since very few people killed with rifles why is it an issue?