When you ask for another path out, do you mean in programming or another field?
There's always lots of jobs in app development, back end, game development, AI/ML, and so on. You still have a baseline of usable skills, mainly debugging and knowing why spaghetti code is bad.
It also sounds like you've been in some bad companies with poor mentoring. You might have to move around a bit, work with a better culture, but they uh, don't hire people who aren't brilliant. It's a circular problem, but moving might help. Code Review Stack Exchange and Programmers SE are good for pointing out otherwise obvious things you have never picked up.
There's always lots of jobs in app development, back end, game development, AI/ML, and so on. You still have a baseline of usable skills, mainly debugging and knowing why spaghetti code is bad.
It also sounds like you've been in some bad companies with poor mentoring. You might have to move around a bit, work with a better culture, but they uh, don't hire people who aren't brilliant. It's a circular problem, but moving might help. Code Review Stack Exchange and Programmers SE are good for pointing out otherwise obvious things you have never picked up.