It's a fair point, but I often see all the ideas I abandoned and realize how some of them could have become profitable had I persisted and not lost motivation. Even a tiny setback (say, no response on Hacker News) was enough for me to stop working on the idea, and start working on something new. Of course, you learn a lot along the way, but to have a successful side-hustle you need to learn to sustain and channel the motivation.
As a creative person, motivation is a wild beast for me. Once I lose it for a project, reviving it feels impossible. But the mindset is a bit troubling. I don't think I would ever work on a project long-term working this way. So, while it's okay to abandon your side-project, it's important to make a mental note of why you're abandoning your project and if you can work on something better next time.