I think the reason LLMs are powerful both in mathematics and software engineering is that in both disciplines there are ways to deterministically prove something (theorem, compiler input) to be correct. This counteracts the random nature of LLMs and coupled with their speed enables convergence toward a desired result even if the LLM is not "smart" enough to solve the problem immediately.
Of course in software, correctness of something like an algorithm is sometimes not well-defined because not all edge cases have been considered. Maybe we can finally have bug free code at some point in the future by letting agents formally verify their algorithms.
I'd argue math is different from software engineering. Math is easily verifiable and there exists an absolute truth. Software engineering is more akin to art. There is no one right way to do things. Requirements are defined by the people, for the people. It's more like clay-making.