As a software developer, more frequently than I’d like. Pouring a couple weeks into an epic only to see the entire thing scrapped… At least I got paid.
Happens with personal projects too sometimes, I’ll start refactoring and decide at the end of the weekend I really don’t want to waste me next weekend on it and it’ll go to the archives lol.
But even in those cases, not entirely worthless. I still learned and grew my knowledge. Same applies to similar scenarios not related to writing code.