There is little to be said that hasn't already been more-than-ably covered already, but since when have I let that stop me?
First: you have mislabeled yourself. This isn't status anxiety. You are not anxious about keeping up with other people. You are anxious about keeping up with yourself -- specifically, that version of you that your parents and teachers and everyone else expected you to be. You know, that perfect, shining star with so much promise and potential. Goddamn I hate that word. When everyone is SO proud of how smart you are and how quickly you learn, you become a trained monkey, jumping through the hoops so people keep telling you how smart you are and give you another cookie. But they don't see you, do they? They see the perfect little trained monkey. And so over time, that's who you see as well. And when you jump or fall off the path, you feel like a failure -- even when it's your own choice, even when you realize that path doesn't fit you, you still feel like you are failing everyone (not just them, but yourself). Because you didn't "live up to your potential." Right?
So here's lesson 1: it is impossible for anyone to live up to that kind of potential. Because it's not real -- it's an image of some perfect child that your parents and teachers have projected on to you. And that image says much more about their imaginary dreams than about who you really are.
Which brings lesson 2: it is not your job to live up to your potential. Because that potential you wasn't you -- heck, it wasn't even real and could never have been. And that means that the fact that you fell off that track early on is the best thing in the world that could possibly have happened to you! Even if it feels like shit. Because your job is to figure out who you are and what you enjoy. And imagine how much harder that would be if you had wasted another 20 years trying to be someone else's version of you! Like, maybe, your friend has done -- I mean, heck, if he has your "dream" job, and he's still depressed, then how much of a dream is it really?
So, suggestions: first, get tested for ADHD. The symptoms you describe are very consistent with that, and a lot of smart kids never get diagnosed, because schoolwork is easy and they never have to work too hard to manage it despite the distractability. (Ask me how I know). And then a lot of kids hit the much harder demands of college or job or whatever, and their minimal coping skills are overwhelmed, and they crash and burn.* Sound familiar? So get checked out, because there are meds that can help a whole hell of a lot, and therapeutic approaches that can help you develop both systems to manage your life and coping strategies for managing the anxiety/depression that frequently go along with ADHD.
And then second, develop the mental habit of realizing that every option out there is open for you -- they all just have tradeoffs that you may or may not be willing to make. Want to do what your friend does and make that kind of money? OK -- learn to code, maybe go back to school, you can do that. But also look at his hours, look at what he actually does for hours and hours, look at his working environment, look at the life he leads. Is he at the beck and call of clients or bosses and required to work long hours on a regular and unpredictable basis? That is a very, very different life than teaching school, right? Will the work hours require you to outsource more, because you don't have time to cook/do laundry/clean/etc.? That means that you are inflating your lifestyle, which means you now need even more money put aside to be FI.** But beyond that, what will that extra money provide you that you do not already have in your life? More stuff? More fancy nights out? That's not the source of happiness. And you know that already, because you're a good chunk of the way down the road to FI while on a salary 1/4 of your friend's -- right?
IME most people get focused on others' successes when they are unhappy with something in their own life. So consider that it's not about your friend's success, it's about something that you feel is lacking. If that is something career-oriented, you have the power and ability to do whatever is necessary to change that. But if it is all about not living up to your potential, then the best path forward is therapy, because no amount of money is ever going to fill up that hole inside of you.
* This possibility is also what gives me pause about you and coding. Because IME, it is physically impossible for ADHD people to force themselves to focus, long-term, on something that doesn't interest them. Which would entirely explain why you switched from coding in the first place, if you chose it when you were in trained-monkey mode because it sounds like a career path that makes a lot of money and makes the parents proud -- great, right? Until you discovered that you fould it dull as hell and didn't suit your skill set at all.
**And don't bullshit yourself telling yourself it's temporary and you'll stop when you FIRE. Trust me: you'll get used to the luxury and decide you like it and aren't willing to give it up. (again: ask me how I know -- you'll pry my cleaning lady out of my cold, dead hands).