I think programming as a discipline is chock full of examples of attribution error. When I think back to the less experienced version of myself, or even the current version of myself on a bad day/intellectually lazy moment, or just reading programming forums for more than a few minutes, I can easily come up with examples.
And I can find plenty of examples where I commit this exact error: many, many seemingly stupid technical decisions that can be explained by the context in which they were made, and more importantly, if I were in the exact situation that spawned the decision, it's not clear that I would have chosen differently either. It's only with the benefit of hindsight that I can disagree with the decision, and the really hard, important, career-spanning question is "how would I have arrived at the right decision in the same context?"
The only remotely good answer I've found to that question is reading extensively, especially outside of my comfort zone, which of course I don't do enough of.