But somehow it is different in software development?
The nature of ditch digging is such that given enough effort, it's probably still possible to dig a ditch. It doesn't mean you'll be motivated to dig the ditch, it doesn't mean it won't be ridiculously hard to dig the ditch, but barring seriously physical issues preventing you from making progress, digging a ditch is mechanical and doesn't really involve a serious need for critical thinking.
When you burn out as a software dev (and probably other fields that involve serious mental investment), it doesn't matter how much you try, there's a good chance you'll just fail.
I do agree that software development is not the only field that can be seriously impacted by burnout, but the degree of impact seems to be highest in fields involving knowledge work.
In both cases the performance was similar. With earthworks I simply didn't give a damn about the job, so just pecked the ground unenthusiastically. With burnout it was as if petard went off, but instead of earbuzz you get numb to planning, focusing and executing. I actually felt bad about it, but doubt you'd see much behaviour difference from the outside.
So I'd wager the lack of motivation is a serious handicap in both cases. Sure, "anyone can dig a ditch" but I dare you try doing it for a day if you are not into it. Similarly I was already an experienced developer at the point of burnout, and the job at hand wasn't challenging at all.
It's not just about motivation, it is just that your perceived ability to execute (going through the motions) and actual ability are completely at odds and you eventually lose all confidence in yourself to continue.
It's not motivation for the job, it's belief in your own abilities / capabilities that erodes your motivation.
You can't whip a tired programmer until they write working code. You'll only get broken code.
A good analogy might be to the division between rank-and-file soldiers in the military, and military officers. You don't need to think to shoot a gun. You do need to think to decide where to send people to shoot their guns.