I've seen videos that show erratic ejection in Gen2's so it seems this is something that has always existed in Glocks, but it appears to have become much more common in recent production.
My Gen3 G27 ejected erratically and I fixed it by installing a "Gen4" .40 28926 ejector into the Gen3 trigger housing of that gun, and using a replacement extractor as well. The replacement extractor alone made a tiny difference, but it was still denting/scraping the case mouths of the spent casings and some were still going over my head. The 28926 ejector fixed it, the dents/scrapes are gone and they all eject to the right now.
I'm surprised that Glock has not started using the new ejectors in Gen3's as well. Currently they're used in Gen4's, and you can get them in the newest Gen4 9/40/357 trigger housings. I haven't checked in a while but I know that 9mm Gen4 trigger housings from MidwayUSA.com, LoneWolfDist.com, and glockparts.com have the 30274 ejector. .40/.357 Gen4 trigger housings from glockparts.com have the 28926 ejector. Other retailers may have older stock that still have the old 336/1882 ejectors, but again I haven't checked in a long time so most retailers probably have the newest ones.
You can't use a Gen4 trigger housing in a Gen3, so you'll need to remove the Gen3 trigger housing from the frame, pull the ejectors out of each trigger housing with a pair of pliers, then insert the "Gen4" ejector into the Gen3 trigger housing and re-install the Gen3 trigger housing into the Gen3 frame. (Gen1's and Gen2's use the same trigger housing as Gen3's) I wrapped the teeth of the pliers in masking tape so as not to scratch or gouge the ejectors. Also DO NOT
try to pull the ejector out of the trigger housing while the trigger housing is still in the frame, part of the frame covers the bottom of the ejector and you will likely damage the frame. You must remove the trigger housing from the frame before swapping ejectors. Here's a thread that goes a little more into detail about swapping ejectors:
You may also need a replacement extractor. Most cases of erratic ejection are fixed by a "Gen4" ejector and/or a replacement extractor. If your Glocks were test-fired in 2008 or earlier, I would hold on to the old extractors because the old ones were investment cast and in my opinion better quality, the new ones are supposedly MIM.