An AR even in .223 will pass through walls and potentially injure or kill anyone outside the home...like a neighbor. This makes it inferior to a shotgun which can use a variety of loads that are far safer...but also very effective for home defense.
AR with the right rounds won’t penetrate as much as 00. I keep a mag of 45 grain hollow points in one for just such contingencies.