Don't worry it's just the impostor syndrome calling you out. It's a good thing because it keeps you on your toes and lets you try out new stuff to do. It may also a bad thing because it will make you feel like crap at times (for which I suggest you get help if you ever feel depressed).
After three years of programming, as you feel right now, I also felt like I'm the dumbest programmer alive because everything I did I perceived to go so slow. I was constantly making mistakes and wondered if this profession is something I should pursue at all.
After five years of programming I successfully worked on projects and still felt like I was a really dumb programmer. I felt dumb even though I actively used three or more programming languages for any project at a time. But things starts to pick up from there and mistakes started to become few as I learnt to be more smart and effective.
Heck, it's been more than ten years since I started programming and though I feel dumb at times because there is some new technology coming out and I feel that I've got no time to learn it. I have come to grips that I'll always be learning new stuff and have to prioritize with what I want to be good at. I still forget to add a semi-colon now and then but I'm quick at fixing it and go on.
The point I want to get to is that you will on occasions still make mistakes and feel dumb no matter what circumstance. This will happen all the time and that's a-okay.
What kept me going is my side-projects that interest me and help me learn. Getting stuff done is also a huge motivator, admittedly achieving this is something I've been struggling with for years when I first started out. Once I shipped my first product it was a huge thing.
Many people will suggest that you start using tools to help you get better, which is fine and all. However no tool will completely help you out with you calling yourself dumb or doing dumb mistakes, they will only mitigate this (except for code linting, it is designed to hurt your feelings). Some people will suggest that it will take time to get good at it, something like 10 000 hours to become excellent at something. But I've found that advice to be super depressing for beginners and be a big discouragement anyway... so ignore it for now... you'll get there eventually.
"To err is human". As long as you're aware that you're just human you should stop fretting over the minor details and continue on fixing and building things. If you ever do a mistake think of it as a challenge. A challenge to keep yourself from making those mistakes. As long as you keep developing you'll get better at it because practice makes perfect.
Just try to have a good work-life balance at the same time so you don't burn out. ;-)