For 9mm, try some Speer Lawman or Winchester 9mm Nato. If it ejects erratically with either of those, the problem is definitely not the ammo.
I have a Gen3 G27 that would eject erratically while my G23 ejected fine, both using the same ammo. I tried everything under the sun to fix it, until Glock finally released their new ejectors. I got one of the new ejectors being used in Gen4's, and put it into the Gen3 trigger housing to use in my Gen3 G27. That ejector fixed the problem. One of my relatives has a Gen3 G23 that has the erratic ejection problem. We've tried shooting each others' G23's to make sure the problem is not limp-wristing, and it's not. Using the same ammo and magazines, the ejection problem stays with his G23 while mine ejects fine. I got a new ejector and installed it in his G23, and he's just waiting for some free time to get to the range and try it.
The new ejectors being used in Gen4's are now available in the newest Gen4 trigger housings. MidwayUSA.com and glockparts.com have both been confirmed to sell the Gen4 9mm trigger housing w/30274 ejector. Only glockparts.com has been confirmed to sell the Gen4 .40 trigger housing w/28926 ejector. All of the other retailers presumably still have the old Gen4 trigger housings with the old 336/1882 ejectors.
Some people have reported continued erratic ejection with the new ejectors, but once they replace their extractors the ejection usually becomes normal. Here's a picture of the new ejectors, currently there is no new ejector for .45, so I'd suggest replacing the extractor:
And here's a thread about the new ejectors:
http://www.glockforum.com/forum/f10/g27-cases-bent-2342/