The FAQ asks users to shed a little light on this situation. Since you’re already working on a fix for this you might already know why it happens - but I’ll pipe up anyway.
In the case of the specific flight referenced above (EGF351) that’s an American Eagle commercial flight. Eagle flight numbers are actually 4-digit numbers, usually.
So, in the above example, EGF351 represents American Eagle Flight 4351 from KORD to KTOL (Chicago to Toledo.) But there’s also an American Eagle flight 3351 from KDFW to KTUL (Dallas to Tulsa.) Looks like it’s picking up both, based on the fact that the first digit (the 3 or the 4) gets dropped off of the flight number. Hence, two flights with the same number (3351, 4351)
(Incidentally, these are technically American Airlines flight numbers, Eagle’s parent company. There’s an entry in the Bug Aware lists to connect express carriers to their mainline parents. I wonder if this will help the bug?)
Also, to answer the other question in this thread, airlines will use the same flight number when they want to offer “direct” service to a location. For example, American Airlines offers “direct” service from Orlando (KMCO) to Shannon, Ireland (EINN) all on one flight number (AAL212). That way they can market the flight as “direct service” without mentioning that the flight isn’t non-stop. It makes a stop in Boston (KBOS).