That's a surprisingly fitting analogy, because you don't know if the person you're robbing keeps a gun under their pillow, and you may only have a second to find out.
Yes, killing them is the "correct" answer if the only thing that motivates you is self-preservation, but it is the worst answer if you consider pesky inconveniences like morality, legality, and basic humanity and decency.