Bruh, you need to embrace it. Even good programmers write bad code. The best code is the product of a long series of iterative refinements, not shat out gold from some mythical top-tier godlike programmer.
You are going to write bad code. Don't get attached to it. You are not defined by it.