The process of creating software, compared to other manufacturing processes, is a little bit special. One unique property of a software product is that it can be changed easily and (relatively) cheaply.
Over in the physical world, changing a product is not so easy. Supply chains, inventory, machinery, whole factories, who knows what’s involved that is either difficult to change quickly and/or prohibitively expensive to change.
So what about this failing more often?
I think most developers have experienced a taks sitting in progress for days or even weeks (or… months!) on end. This long running work eventually gets merged and released but it turns out it’s the wrong thing and a large part needs rework.
The solution to this struggle is two-fold. The first half is getting invested in your customers. Talk to them, establish a good relation with the people that actually use the product you are building.