It's easy to get caught up in it.
Imagine you really hate your body, you are being bullied because you don't fit the stereotypes. Boys no longer play with you but do start looking for a bra strap to ping. You are very unhappy. Imagine all that leads you to feel that there is something wrong with you. Because other people are happy, you must be at fault.
You can see all the problems start when people are calling you a girl and get worse as your body changes. Those changes make you ugly, cause you pain every month. You really don't want that.
There is something wrong with you, you don't see why you are not a boy. It doesn't make sense ( remember you are 9 or 10 here, only a sad and lonely child with a child understanding);
Then someone say " oh but you are a boy really" . It feels so good, suddenly instead of people calling you a weirdo for being you and being good at maths. someone says it's perfectly ok.
It makes sense, and if only the world would agree , your problems would be over
It doesn't matter that it's a stereotype that says girls can't do maths, if you are bullied for it you don't see it that way