This really resonated with me. I personally struggle with this on and off. I just call it the programmer's curse. I sometimes wonder where this "fear" originally came from. Did I pick it up from other developers? Did it evolve over time from seeing the mistakes of others? Somehow I came to associate this fear as something good developers are suppose to feel. Indeed I probably need a little bit of this or I might make some really dumb mistakes. But sometimes it really is paralyzing. It can be really hard at times to let go and convince myself that I don't have to find the perfect solution for every challenge. More specifically, I get hung up trying to predict future problems and solve them. Sometimes you just won't know what will be thrown at you and your code later. It probably goes along with what you described as wasting work. I really don't like the idea of solving very similar problems with duplicated or redundant solutions/code. In end though we often have time constraints and failures beyond on control.
I feel like I had a better grasp on this when I worked for others. But now that I work full-time on my own startup I tend to be even harder on myself.
(Completely unrelated, but I just wanted to say ciao. I saw you're based in Sicily :) My mother is from Milano. I lived there for a couple of years as well. Oh how I miss the blood oranges...)