Man that .223 is a different animal though. If they're both jacketed without some cop killer feature I think the .223's speed is the deal changer.
They invented the .40 because the FBI got into a shootout and shot some guy umpteen times with a 9mm and he kept coming. I don't think anybody keeps coming after getting shot multiple times in center of mass with a .223.
A semi-auto 12 gauge would be infinitely more devastating in virtually every single mass shooting scenario than a .223 - yes it's speed can cause a shockwave, tumbling and even fragmentation in some cases, but sometimes it also punches a nice neat hole - depending on the tissue it penetrates.
Larger caliber, slightly slower moving rounds like the 30 06 or .308 can still do the same thing but with a much bigger piece of lead that more consistently leaves bigger holes.
Hollow point pistol rounds can be equally devastating.
Shotguns in a crowd would consistently do more damage than anything else.