I have such a weird take on this, due to being in the military for so long. We absolutely do refer to one another as "males" and "females".
Ie. "There was a female SSgt that was really helpful in customer service" or "I had to remind a male Soldier to put on his cover when he left the building" or "I had a female troop once".
However, I try really hard when I'm speaking to a non-military member to switch up my phrasing. Sometimes I still slip up, and I gotta be like "shit, sorry, I mean that woman cashier over there" or whatever it is that I'm talking about.
I will say though, I do distinctly remember having that conversation during basic training, and fucking hating being referred to as "female" in the beginning, and that thought being shared amongst my flightmates. I can still hear the TIs shouting from across the parking lot: "GET OVER HERE RIGHT NOW, FE-MALE!" Ugh.
It was just 16 years ago now, so "female" has become normalized.
In your first examples, you are using female as an adjective. A female troop, a female Sargent, a male soldier. That's usually fine. Even "that female cashier over there" is probably fine. However if you say "that female over there" or like you pointed out, "get over here right now, female" or really any other instance where female is used as a noun instead of an adjective, that's where it becomes gross. It's all about adjective vs noun. Adjective: usually fine. Noun: usually not.
Yeah after I posted the comment, I was reading through other people's, and someone pointed this exact difference out. This take makes full sense to me!!!