Before, I asked what the phrases were used when you were in a bathroom and heard the door knocked (https://english.stackexchange.com/q/471452/321003), and I received a lot of example answers. Among them was “Someone’s in here.” And this is beginning to bother me. As a Japanese learner, I think I tend to say “I’m in here!” for “Someone’s in her!” Why is it “someone,” not “I?” I’m wondering about that.
Saying "someone's in here" instead of "I'm in here" adds a degree of anonymity. You don't know who is knocking, and they don't know who is inside. The identities of the parties in the "conversation" have not been and will not be established. Therefore, although "I'm in here" is perfectly grammatical, it feels wrong because the knocker doesn't know who "I" refers to.
Every language has particular ways of saying certain things, which do not arise from specific grammatical or semantic rules, but from habit. Some things are just usually said in a certain way, and people get used to that way. It becomes the norm, even when other ways of saying it would also technically be correct.