I wouldn’t be surprised if the overruns from James Webb didn’t affect this program, either.
After 30+ years in the aerospace industry, all I can really say about NASA’s funding is that it is capricious.
Also, Congress can mandate what NASA must spend its money on. The recent SLS launch was years late and billions over budget, but Congress passed it so that former Space Shuttle contractors would still get money. Many in NASA would have liked to cancel the rocket and spend the money for other projects but Congress forced them to build it.