Before you get to the point of destroying your own property, you should have already double checked which unit you’re at, whether a family member has a spare key, or whether someone you know can let you stay the night so you can call a locksmith in the morning. It’s entirely reasonable for someone inside to think that it’s an attempted break-in, so even if the guy just made a really bad choice that ended in tragedy, I don’t blame the shooter for thinking it was a robbery, and not wanting to risk the supposed robber having a weapon. It’s not an easy choice to make in that situation.