I've had this happen a number of times.
In much younger and slightly geekier days, I attempted a couple of spec scripts for Star Trek: The Next Generation. One that I was excited about, but never completed, was foiled by The Pegasus, written by Ron Moore.
I had been bouncing my screenplay "Hot Coffee, Warm Donuts, Cold Blood" around for a while, including submission to the first Project Greenlight, but then the basic high concept was used in Scotland, PA.
I worked for some time on a Zombie Epic. Much of what I'd imagined remains unused, but most of my best set pieces have shown up in the slough of zombie movies that have come out in the years since.
Maybe the bizarre amalgam projects I've been playing with in recent years are a response to this very issue. Or maybe I've just become stranger and more radical in my old age. Who knows?