I doubt we'll know exactly what did jw's, but I've helped resolve those issues several times, no eggspurt or gunsmiff though.
It's pretty common for improperly tunned autoloading handguns brass to hit the ejection port & various other places. Usually extractor or ejector adjustments can make stop it.
In rifles it can be those things & more. Can hit scope/mount ect. Normally comes back to the extractor /ejector. You can make any gun(almost) eject in a neat little pile if you watch someone else fire it & adjust accordingly.