If your child had said they "felt" or "just knew" they were Japanese, assuming of course you aren't Japanese, would you have agreed with surprise that apparently you have a Japanese child? Would you be telling us that you have no idea why, because there are no Japanese cultural stereotypes in how you treated them, and yet somehow, here you are?
Of course you wouldn't. Because that is ridiculous, right? Someone can love [their idea of] Japanese culture, can have a fixed idea that being Japanese would be right for them, but that doesn't actually make them Japanese. Being Japanese is a specific thing and your child is not it.
So why is Gender different? Why ifyour child says they are a different culture you'd say "No you aren't" but if they say they are a different sex you'd say "yes you are"?
Quite simply, because you see these things differently. You believe the first is impossible but the second is not, so you would meet the first with "of course you aren't, don't be silly" and the second with "well, maybe you are. Tell me about it".
You think it came entirely from your child but actually it was you as their parent who applied the decision that this is a "real" identity not a childish belief in something impossible.
(1) Of course a person can become legally Japanese by moving to Japan and gaining Japanese citizenship, but it doesn't happen because they have pre-existing intrinsic Japaneseness, it's because they pass some admin that is equally accessible to people who never felt Japanese a single day of their lives.