First it’s a terrible idea to make big life decisions based on people knowing you the least: Internet strangers. You should have serious conversations with various professors, post-docs, and grad students.
While genetics undoubtedly play a factor as they do in most things in life, and many math superstars are likely endowed with good genes, in most cases upbringing plays a much bigger role. Many of your peers practiced mathematical problem-solving for years and it would be unrealistic to get to their level in a short amount of time.
I can relate to you as I also come from a different field and I asked my professor the same questions. He told me that working hard is not enough, you have to work smart as well. That is, you have to deliberately spend effort developing effective study and problem-solving skills tailored to advanced math. For example in intro analysis, I draw a lot of pictures (mostly points and balls) to get intuition. A single problem set only covers a few theorems and definitions so you just need to figure out which ones are relevant for your problem. When I inch toward the conclusion, I signpost every step so I keep myself on track and minimize logical errors. If direct proof doesn’t look promising after some attempt, I switch to contrapositive or contradiction (and you get better at identifying when proofs should be done this way from practice). It was also very common for me to spend hours on a single problem, but I take breaks. If I can’t solve it in 40 min or so, I either move onto the next one or take a walk outside so that I let my brain work on it in the background (“diffuse mode”). Often when I come back to the problem my diffused mode brain already come up with a different approach. This is also why I start problem sets as soon as they are assigned so my brain can work on these problems in diffused mode for days if needed. Once I have attempted enough but can’t get anywhere, I go to my peers or office hours to get unstuck and then reflect on how I could’ve gotten the insights myself.
What I’m trying to say is that for people who only got into math in college, it’s very common to take a longer time to digest concepts or solve problems than peers that are ahead due to upbringing. The best way to catch up is work hard AND smart (“deliberate practice”). Eventually your advanced peers will hit their bottleneck as well and they will face the same problem that you face now. If you pick up the effective learning skills now I would not be surprised if you go further than your advanced peers in grad school (if that interests you) as they relied on their “talents” too much and never learned how to learn. If your professors/TAs are good, you can pick up the skills in their office hours. Otherwise you have to do a lot of self-reflections and experiments to develop the most effective skills for your learning. I already gave you some examples and hopefully you can extrapolate.