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.