I've noticed that lately I've consistently adopted this approach to working with code - I often do work twice.
The first time - I still don't fully understand where I'm going. There's sort of a general plan, but each next step is still fairly random and can change based on the results of previous ones. I might realize that the solution doesn't suit me. That there's a blocker somewhere down the line, due to which I needed to go a different way or in a different sequence of actions. That I did a volume of work that's now inconvenient to review and test. That I touched something unnecessary. That is, along the way you're working on a large number of loosely related subtasks, which are long and painful to deliver all at once. But until you do everything completely - you won't understand how to do it better.
The second time - already after doing everything, but with the height of experience gained in the process of completing the task, you simply do everything the same again. This time you properly decompose, don't do unnecessary things, break it into sequential commits or even into parallel merge requests. And it turns out, suddenly, well. Much better than the first time. And you spent some percentage of the time that the first attempt took.
And developers complain when you ask them to split a merge request with 50k lines (exaggerating) into several more atomic and sequential ones. It's understandable that this shouldn't happen in principle, but who hasn't had it? You often encounter a lack of understanding that a large volume of interconnected work is much harder to bring to production than the same thing in short iterations. Like "well, we already spent time doing all this", "just need to test it now and we can merge", "what, do I have to redo everything?". Yes. The cost of code review, the cost of testing, the cost of fixes based on code review and testing results grows much more from the volume of work being digested than the cost we'll pay now for your second pass.
And here's the question. Is it just that my tasks are all experimental like this, which can't be planned in advance? Have I unlearned how to plan? Or never knew how? Or maybe I'm wasting time? Or am I actually doing great and everyone has been doing this for a long time, but I only understood it now?