I have had months and probably an unproductive year. But 25 years developing one application from conception to sell out is a long time. The payoff for creative work isn’t controllable or predictable.
Chiming in, I've had several low-productive years at my previous jobs, the assignments just weren't for me and I had some over-eager colleagues who I couldn't keep up with.
Switched jobs and I've got a ton of stuff to get on with, mostly self-managed as well. So far (a few months in) it's done wonders for my productivity and I've churned out more code (that I'm actually quite happy with) than I have in the year preceding it.
Not a remote job, but 1-2 days / week are spent working from home and given that my task list is still quite fresh and I'm not bogged down yet with my own poor decisions / tech debt they're usually pretty productive as well.