There definitely are times that I lose the "joy of coding" and it has nothing to do with any illusions, it has everything to do with the kind of programming tasks I have to work on. Greenfield projects are the best, tech debt is the worst. Working on fun stuff is just fun.
I'm not suggesting that the joy of coding is tied to illusions for everyone, just appears to be more to the story in the case of the author based on his framing.