Anyway, I remember back in the days I could easily spend months working on a the same project 8 hours a day with the feeling of excitement. Nowadays if the ticket does not look exceptionally difficult (in a sense - you have to spend waaaaay more time thinking than coding), it can take me hours before I can even force myself to take it and start coding - and I honestly hope something breaks in a meantime so I can work on an outage instead. My productivity is still above average so nobody notices, but I struggle a lot. On the other hand whenever there is a nasty bug nobody wants to touch, I take it on the spot and feel a lot of joy tracking it down 3 days in a row, going through logs, metrics and several apps I'm not even that familiar with. And I'm really good at it.
It makes me wonder - did anyone feel the same? Is there a niche/role where you can mostly take care of bug fixing/diagnosis? I would like to believe so, on the other hand it's harder to fix bugs in a piece of software you do not work with on daily basis. Or maybe this whole thing is a clear sign of burnout and I will get bored with bugfixing in a few months/year as well so I should still think about transitioning to a non-engineering role before it gets worse?
In my experience, large companies tend to have this -- it's called a "maintenance engineer" or "maintenance developer".
It's a hard job for the reasons that you cite, but I personally enjoy that sort of role a lot.
For the former, I solved it by making something kinda like what I was assigned to make, just to get something in the text editor, then change that to the needed product. For the latter, building confidence with other activities like piano or lifting weights helped a bunch.
Maybe a good vacation is in order either way?
Here's hoping whatever's blocking you clears up.
I've often wondered if I'd be more suited to working in security and doing something along the lines of reverse engineering. Or maybe doing something like SRE where the job is solely optimizing systems and tracking down issues.
Always consider transitioning to a non-engineering role, but perhaps, not so urgently. The job market isn't as great for seniors as it is for mid-levels, but it's still quite good.