It's a circle I've been trying to square recently as part of my career.
Backstory essay: I'm 6 years into my career. I spent 5 of those in the same company - company A, working up from a Grad engineer to an SDE3, 3 promos, in that company. I had a very few stumbles there and always performed and handled transition pretty well.
I jumped ship January of this year over company changes, projects getting cancelled and stopping from a revolving door of Product heads coming in and out. My goal is not to get a senior title but to progress in my knowledge and move on from JS over to a Java focus. I want to build a product or even just some features; I want to code and earn my way to seniority; not start and stop every quarter.
I move to the next company, Company B, in March as SDE; everyone else on the team is Senior SDE with 7+ years experience and above: I'm the most junior.
Company B is a start up and I'm expected to contribute from the off; build out big features and bring some solid knowledge base to the team... but I just totally crap the bed.
The code I write is problematic; there's no documentation to set stuff up, so I go without the code running on my local machine for a while, which obviously causes issues. I make a bunch of amateur mistakes and my direct team lead takes a dislike to me for, naturally, messing up a lot. I go from the guy who can solve the problem and save the day to the guy causing the problem; I'm not trusted at all (and why would they)?
I'm lashed with negative feedback in my first couple weeks, so buck up and genuinely put huge effort in; my code gets better, but the team lead expects tickets closed faster than I can. I feel incredibly untalented and dreadful at my job; every one of my system design choices are the incorrect ones and aren't taken into account. Eventually - right before probation ends - I'm terminated when I fail to complete an MVP of a new system feature.
Obviously, I'd seen the writing on the wall, started interviewing elsewhere and now work at Company C, but as a Senior Software Engineer this time.
Company C is a big company in a bit of a niche area. I'm working on a team migrating from a dreadful old system to a more modern Micro-service base system. I'm expecting to do dreadful and underperform, get fired and end up exiting the industry within a couple weeks.
Instead, I'm back to my old self again: I'm reviewing code with confidence, pushing up solid features, contributing to initiatives and mentoring junior developers again. The code and features I write are solid and passing QA.
There's no tech lead helping me, so I'm just using my gut and it's going swimmingly. I have discussions with the other senior engineer on the team and my technical knowledge is respected; my relationship with my manager is pleasant and I'm performing accordingly.
It's only been a couple months but I feel like myself again; like I went from the back of the herd to the front of the pack... but I'm still so confused about what exactly is the root of my performance increase; or rather, what made me become worse.
Has anyone else ever had this sort of experience, this sort of bumpy ride in their career? Are start-ups hard to work in that larger companies specifically because of expectations, of what's considered "appropriate" at different levels? Am I just a lucky idiot fumbling back in and not even realising?
The short answer is: Yes, everyone falls. And then you get to learn how to pick yourself up.
Sorry to say, but your story is more mundane than you're making it sound. Everybody falls. You got to see firsthand how a low-support environment and an overly-emotional "leader" can completely fail to capture value from a provably skilled and valuable employee. And then, right after, you got to see the value of trusting your instincts, having good relationships, being on a team where you feel psychologically safe and feel like you truly belong.
Yes, you were a little bit lucky — specifically, your luck was that you got a good job immediately, whereas plenty of people (including folks more senior than you) sometimes get hit by bad luck in the job search process. But you would've found a good job sooner or later, so I wouldn't chalk up too much to luck.
Overall, you got to do some growing up, and it will serve you incredibly well in the long run.
Consider: How differently will you approach the next engineer you mentor? How differently will you deal with stakeholders now? How differently do you feel about the importance of onboarding, of second chances, of objective performance-review processes?
Every misstep has a dozen lessons we can extract. I'm impressed by how quickly you picked yourself back up. I hope you set aside some time to reflect and extract all the valuable lessons, too.