This has never happened to me or anywhere I've worked (except see below) because we always had reasonably defined goals, maybe at the high-level only, but they were clear and we could work on them. Except for research projects you should have a pretty clear understanding of what's needed because business is a pretty dull, straightforward thing.
Okay, the exceptions: management failures. When them who should be doing their job are too fucking incompetent to pull their finger out of their arses. Years ago I worked at one place where they had 3 home-made frameworks floating around the company. A framework was clearly needed, management just dithered, so 3 different programmers just got on with it and did the necessary creation. Triple the work done, and an inevitable political war was brewing over which one would be used. And this was a medium sized company producing accounting software, not some inexperienced startup. Oh yes, I do have other stories like this... Crap management is a curse. It's always management IME. Fuckers seem to breed like rabbits too. Yes I am bitter.