Ask HN: I've realized I'm a bad software engineer and I'm over 30, what's next?
I'd argue differently. Congrats for having the courage to recognize your problem.The analogy that comes to mind is I've been playing basketball in my local town, and now I've gotten promoted to play in the big city. I now feel like a small fish in a big pond.If you enjoy software engineering, I'd say, double down. Now that you're at the medium software company, seek mentorship and coaching from others.In addition, there might be more homework (hitting the gym sort of), things you also have to do on your own.It isn't going to feel good being humbled and I've been there myself. But if you think about the goal as "learning to get better" than "prove to others I am better", you'll have a better time walking through this challenge. This all comes from a person who is a PM.So some tactical thoughts of possible advice: 
1. Face the issues head on -> take all the negative feedback on the code and rework the medium complexity task
2. Learn to unlearn bad habits. Yes, it's harder, but it comes with practice. 
3. Commit to maybe taking a course work online (maybe seek advice from others on what are good ones to address weaknesses you have)Hope this helps.BTW, you don't need to be able to code things the right way to be a PM. Coding is only one specific skill and not always necessary for a PM.