The changing nature of the job is definitely part of it. When you're on the steepest part of the learning curve, that makes up for a lot. I still learn plenty, but less than I used to. Instead, I spend a good deal of my time correcting mistakes made by those who hadn't learned yet. Mistakes happen, that's OK, but it's still less fun than learning new things myself. At my age/experience there's also an expectation that I'll do more "force multiplier" work - for me it's often fixing broken infrastructure - so that
others can stay more productive with straight coding. Again, nothing wrong with it, but still less fun.
When it gets downright tiresome is when being the project janitor puts me in conflict with young "tech leads" who denigrate those contributions because they've only ever worked on that one project where other people took care of those things for them. It's like the difference between living in a college dorm where everything's taken care of for you, vs. having a house and kids and bills of your own. Being a strict individual contributor with no cares beyond the one piece of code in front of me is just a fond memory.
Unfortunately, few companies will hire someone with 30+ years' experience just to write code, even for a salary appropriate to that role. Companies want to pay those lower salaries not only for direct work product but also for growth potential. The worst part is, I know they're not wrong. The only way to do the kind of work I really enjoy, and only that work, is as a hobby.