I've probably created a hundred or more proofs of concept for things that turned out to be a bad idea. Say these averaged out to a week or so of work each, and that's about two full years of useless work.
And that's ok! Most stuff you work on will get thrown away before you leave a company, and the rest will get thrown away not long after that.
This doesn't really bum me out, but I can certainly understand why people experience it that way.
Honestly though, I think it's worse when things I've created do persist for a long time. They're never nearly good enough and I hate to think that they still exist nonetheless.
I guess my point is: try not to sweat this stuff; it will drive you crazy.