Your soul is probably waking up. That's the black lung of coding. You have three, maybe four choices. Visual arts, music, and writing, with performing with an asterisk (it's not for everyone.) Get used to being a lot poorer, but happier.
Take it from someone who fucked up and went for arts: You get demotivated there too. At least with math and programming jobs, you have some money to fix things.
This is wholly a un-based feeling, but I feel that it has been a lot easier to pick up new and professionally useful technical skills in my 30s than it would have been if I had done well in my 20s with a technical career and had to pick up the useful philosophical and musical skills I enjoy using in my 30s.