Good points. The gun would have to cycle with CO2 or magnets and feed from a magazine empty casings so that the ejector continues to do its job.
Yet so many movies just add the sound of casings hitting the ground so I wonder if the hassle is worth it except for some specific shots. I enjoy the realism but I’d rather people not put their lives needlessly at risk.