I'm sorry I didn't see this thread earlier, I'd thought that this issue of BTF was well known...as was the cause.
The issue is that current Glock's extractors don't have secure purchase on the case rim after the case is extracted from the chamber. The case just "floats" atop the round coming up in the magazine. If the extractor pulled the case out with enough force (why changing extractors sometimes helps) and the inertia throws it against the ejector (why changing the ejector sometimes helps) hard enough the case will eject as it does on other pistols. If the preceding conditions are not present, the case is struck by the breech face of the returning slide, which then throws it against the front of the ejection port, which it turn throws it back into the shooter's face.
This is easy to test on your Glock:
1. retract slide and insert loaded magazine
2. release slide and chamber a round
3. remove magazine
4. fire chambered round
5. if the empty case falls through the magazine well instead of out the ejection port, your extractor doesn't have a secure purchase on the case rim