not .223, or .45, which are both lesser choices but better than nothing at all..
I can think of several reasons why a 223 from a carbine would be a better choice than a 12ga for HD...
If youre concerned about the neighbors, a shotgun loaded with 00buck can over penetrate drywall more than 223. Even 9mm will pentrate farther than 223 through drywall.
At average room distance, 12ga shot spread is can still cause misses. You will still need to aim as carefully with a shotgun as you will a rifle or pistol. You will also need to be very familiar with you stogun's pattern. My Mossberg 590 patterns at 3" at 5yds, and 7" at 10yds. I can easily miss my target with a poorly aimed shot from my Mossberg at 15 ft.
Unless youre using a semi-auto shotgun, a pistol and carbine will out perform a shotgun in regards to follow-up shot speed. Even with semi-auto shotgun loaded with 00buck, it is easy to send follow-up shots much faster with a 223 carbine or my 45acp handgun.
Under stress, I have short shucked a pump shotgun. Not a fun problem to clear when facing an adversary.
A shotgun will never offer the ammo capapcity or speed of reloading that an AR does...the only advantage a shotgun offers is the ability "top off" its mag.
As for sheer knockdown power of a shotgun, my 223 will likely penetrate any body armor a badguy might be wearing. Im not so sure about 00Buck pentrating a vest... And if he isnt wearing a vest, a 223 bullet from 10 yards is as DEVASTATINGLY messy as a load from my shotgun...