You will be wrong every day you write code. There are many great reasons for this and the main ones have to do with you personally, here's a few:
- Software Development is incredibly complicated. There's basically no one out there that can hold every detail of a production application in their minds.
- You are working collaboratively. You may know what should be happening, but that's no guarantee it does work that way! Errors and miscommunications will happen.
- Every language feature, tool, and library you use was designed by another human. There is often no way to guess how something works, you need to read their documentation. And documentation isn't always clear or correct.
- You are never doing the same task twice. Every time you sit down to write some code, you are approaching a brand new problem with tools that are always changing. No one can be right every time about something they've never seen before.
You should seek out being wrong, always look for how you are wrong not how you are right. This is how you will break your knowledge and reconstruct it stronger than before. Embrace the fails!
If you are cruising along building projects with no problems, being right all the time, you're missing the point. Studying and learning isn't about repeating what you understand, it's about finding the weaknesses in your understanding and correcting them.