I've experienced this at almost every job I've ever had. Best case I can get two years of productivity and then suddenly I can't even start, no matter what I do. Nothing works. Not site blockers, not isolation, not pomodoro, nothing. It's as though I'm physically unable to begin. It's not just difficult, it's impossible.
I was told this is strongly suggestive of ADHD, which sounded preposterous to me, but after the third health care professional (none of whom knew each other or shared records) asked if I'd been screened for it, sure enough... I have ADHD.
Now I'd love to tell you that everything is fine now that I'm diagnosed and under treatment (a few years now), but it isn't. Maybe my meds aren't the right ones, maybe I haven't learned the right skills yet, maybe this industry is just plain fucking boring and I should accept that and move on. I don't know. I don't have the answer yet.
So, sorry I can't be more helpful, but maybe there's some comfort in knowing that this is a thing and it's not just you.