Basically, it’s better to do than to not do. But there are exceptions.
Sometimes something just isn’t working. It’s sometimes better to stop that and do something else, start on a different idea. Finishing isn’t always the best option if it stops you moving to another project that flows.
But there’s always a paradox to resolve: do I need to stop working on this piece because it’s not working, or is it not working because I just want to start a new piece?
Continuing a little too long on something to be sure it isn’t going to work might be the only way to tell. But you’ll be able to.