Are they? The jobs of programmers are definitely at stake; at any given time there's some fixed amount of software that can be consumed. Mathematics research doesn't have an economic buyer. If you raise the complexity floor for discovery, you reduce the annual productivity of a researcher, but that might not matter to the field.
I don't think current mathematician's jobs are at stake, as much as the field itself, if LLMs take all the "easy" problems that phd students would try to learn by solving on their own. Mathematics is susceptible to the same ladder-pulling situation that we see with junior programmers and LLMs.