I’d certainly prefer the .12 gague over an AR for indoors work. One can make the argument, however, that a handgun is better indoors than either because it more mobile and easier to maneuver in narrow hallways and doorways. I’d still go with a .12 gauge loaded with alternating slug/buckshot rounds. The buckshot slows them down and the slug finishes them off.
The finishing them off part, while gratifying, gets you locked up for defending yourself.