It turns out that sitting in front of a screen solving mundane logic problems all day isn't exactly the most desirable thing out there. Why would anyone want to write more code when they have to do it for the bulk of their time? That stopped being compelling after my first burnout, it's only compelling if there's literally no other hobbies I could engage in.
Note that there's a difference between programming in general, and software development as a job.
It's like loving coffee, so you want to be a barista, but then you realize the job of a barista is actually horrible and largely has nothing to do with coffee, so you start drinking tea at home instead and look for a way out.
The answer? Do less work, do less programming, use the time for something more worthwhile, and the interest might come back with time. Get your job done as quickly as possible, then leave the house and explore the world. Job is done if the job is done.