first,
FACT:
a shotgun inside a house will not "spray the wrong target." At that range, it's essentially a solid mass, as was noted. No different to aim. And that "claCLACK!" is a GOOD eye-opener.
Second, a normal shotgun is a lot less threatening in court, as was already discussed.
Third, inside, ANY large pistol, shotgun, or rifle is going to cause hearing trauma. Period. So don't even worry about it.
The .22 is actually a very good choice. A 10-22 can empty a lot of rounds in a hurry, that will shred the perp. Don't worry about "knockdown power." 1) it's a myth (see Thompson and LaGuardia), B) the .22s will dump most of their energy in the target. Game, set, match.
SPECULATION:
considering the velocity, the projectile shape, and cross-sectional density, I won't even begin to believe a 9mm out-penetrates a 5.56 until I see the experiment. Twice the velocity, 1/3 the cross section, in soft materials???
umm, no. Again, speculation, but I've fired a lot of both.