You can learn to recover from mistakes.
I don’t think you can do everything perfect. Maybe you can on solo projects but not when your project involves other people with conflicting values.
While I do things the best I can, I don’t kid myself to think I can do them perfectly from everyone’s perspective. Having the goal sets you up to find failure where you don’t have to.
When you own up to shortcomings or unresolved conflict, people see you as more approachable, which helps if you want to lead or influence them.
Fixing your mistakes and handling fallout from them can improve your situation more than having done things perfectly from the start.
I recommend learning to handle problems than kidding yourself that you can avoid them completely.