*sigh*
Yes, it pisses me off for you as well, Julie.
But, most legislation 'protecting' jobs and against 'discrimination' is only as good as the company in question wishes it to be. There are always all sorts of ways around protection for those the management, from CEO down to floor supervisors, doesn't wish to protect. Sadly, nothing with any sort of real teeth that might rely on inferential reasoning applies in courts of law or in refereed employment hearings.
One can cover her own behind as best as possible, do excellent and productive work, bring in huge profits for the company and they will still screw her if that is the wish of those in management, or at least those who have enough power to make their will the company policy or direction.
It's very angering that this happened to you for me. Given that, I can only imagine the pain, anger, shame and general feeling of rejection you must feel. And no genius is required to link your being 'passed-over' in favor of a new hire for the position with your informing the company of your transition.
Trouble is, in a court of law, the reality isn't real provided the defendant didn't actually place something to the effect in writing or discuss it indiscreetly with people who'd be willing to testify to that fact.

Nichole