How dare you shoot a mostly peaceful uninvited visitor!
That theory is often correct.
Of course, robbers can get the wrong address, just like SWAT teams sometimes do. Even more so. And some criminals simply like to do robberies. They are in it for the excitement.
It kind of sucks when the resident is actually an innocent victim. That usually gets straightened out pretty quickly though. Just need to get past some awkward questions and unexpected rudeness from the officers.
Either way, having a dead robber is a good outcome.