Math has two things that are part of it that are a key part of software development.
There is the "this doesn't change." In many other jobs you can bend the thing you are working with to your will. Bend that pipe or apply just a bit more force here. Having plumbing being off by a little is often good enough for the tolerances.
Math, you can't do that. There is no way to push a bit harder and make one value a different value. Yes, there are ways to manipulate systems of equations - but at the heart of it, you have to submit and match the mental model of math rather than being able to impose your will on the material.
Carpentry? The wood doesn't bend the way you want it to? You can blame the wood, throw it out and start the process again. It may be costly over time, but doing the same thing may have different results the next time.
Software development and math - if you do the same thing again, it doesn't change.
The second part of this is the how you approach a very large problem and apply an algorithmic approach to breaking it down into smaller and smaller problems until they are solvable.
That isn't a "you can't use that approach on carpentry or plumbing" (and it is often that you do), but rather that it is necessary to do this in math and software development.
The knack for math is more about the acceptance of the inflexibility of numbers and computers along with the nature of the tools used to solve those problems. That said, some of the tooling for one or the other may be difficult to get your mind around. Calculus and derivatives and matrices... they are things that the tools to solve them and I go blank with them. I also know a sysadmin who was a math major who is proficient in PowerShell, but the parts of strongly typed larger codebase and he appears to have similar distain for it that I do for matrices and calculus.
> Most of the time the elegant software solutions come not from writing brilliant code, but from reframing the problem so that simple code can solve it.
This is also at the core of solving the harder math problems.