They're working on it. NASA HQ has already cut their "Office of the Chief Scientist" (among others) and the current proposal is to cut 50% of the science budget (which would effectively kill it, it's already been squeezed).
SpaceX might be the one that takes it to orbit, but that's the end of their involvement. It would be one of the NASA run locations that would be controlling the craft, receiving the data, analyzing the data, etc. The JWST is not a French contract just because it caught a ride on an Ariane rocket.
To call that a SpaceX contract is a very myopic view.
And to add to that, DOGE has been known to cancel contracts where the money has already been paid (so we're effective paying for nothing); SpaceX already has what it needs from this contract and has nothing to lose by cancelling the mission now.