This is probably a pretty typical story but I don't think I've ever put it in writing, and maybe that might be good for me, so here goes.

I got pretty burnt out in my second last role. A change in tech leadership saw the arrival of someone who took to shitting on everything, suggesting instead the combination of several OTS products. They were gone before the project even really took off, but the effects were already in full swing; culture destroyed, us vs. them mentality, job insecurity, loss of autonomy due to Committee For Improvement, high turnover, backfilling with anyone with a pulse. All of these problems were left to fester, or worse in some cases, exacerbated; project devs started to leave, so they upped project dev pay.. guess what that did to the morale of non-project devs.

There was no escape; I couldn't simply put my head down and keep doing good work. Material was being disseminated by the org to justify the big project, and it specifically called out my team's applications as unfit for purpose now and into the future. Particularly frustrating were the outright lies in the material about my team's applications, presumably used to build a narrative that the big project was the only way forward. The big project was penny-wise pound-foolish; they could send 100 staff on multiple team-building days, but refused to furnish their team with a key piece of $2k equipment (sorry for vagueness: trying to stay anon here), instead demanding my team share ours. There were ridiculous exercises mandated where developers had to document "how" to do their job so that it could be compared with "how" a developer job would be performed, post big project. But I think worst of all was that myself and my team were no longer able to work with smart people; the product owners were backfilled with imports from the org's call center. Every day seemed to be a fight just to write good software and keep the product afloat for the 100,000+ individuals using it.

Leading up to this, each year I used only about 25% of my yearly leave; I worked hard, took work home with me, and genuinely wanted to grow myself. When the big project rolled around, I felt my investment going south. All the knowledge, rapport, and comfort I'd established was about to evaporate. The value of my team's work was being actively undermined by the org, and any new work inherently had no real value. Before I left, we quietly completed a 5+ year project consolidating our legacy platforms, and we got a 10-second mention in a unit meeting.

In the last year I was starting to get physical manifestations of stress; headaches, unpleasant pangs in my chest, anxiety, grinding my teeth in my sleep. This was all a first for me. I took a month of my leave, but that didn't help. I took another month, 2 months later, but that didn't help either. So I quit. It took several months before the 'symptoms' eased, but I still get some of them when I get stressed.

I thought I'd be ready for another job in 3-4 months. It's been 16 months and I'm still dreading it. I took a job about 7 months in, but it was shit in its own unique ways so I left after a couple of months.

In my time off, I've built a couple of little things for fun, consciously trying to fight any thoughts saying I need to make progress, or I need to build something worthy of publishing, or I need to learn a new technology so that my time off wasn't a "waste" in some recruiter's eyes. It infuriates me that the developer is expected to spend close to 100% of their time generating value for an employer OR improving their ability to do so. It has actually been good to work on these little projects, and has confirmed that I do love writing software, but I'm starting to believe my career will kill my passion for writing software.

OP, I found this to be helpful in understanding my burnout: https://commoncog.com/g/burnout/. My post certainly doesn't have any answers for you, but at least you know you're not alone.