the magic is not specific to the thing like programming. so you lost the magic, it no longer compels you. i suggest thinking about the why behind the why. why did you get into programming? for me my why behind the why is "i like to make things". it's more nuanced, i learned html and css cuz i wanted to make a website for a t-shirt company i was also "making". HN is big on entrepreneurship; it's because a business is just something to make with a lot of upside. most technical people are "makers".
i'm intentionally riffing, no direct advice. Ask yourself more questions about why you see magic.
btw: after 12 years doing software, much magic is also gone. another commenter mentioned what a shit show js frontend is. What you're feeling doesn't get better lol. Rather, we can reframe our perspective and appreciation. I still code and still want to make a business. but hell no i'm not the 23yr old i once was. and can only do a few hours a day. The world has lots of magic in it!