As several PPs alluded, there seem to be 2 issues - not being invited and gender-specific party.
Â
Gender-specific party:
For a few bdays DD wanted just girls - at the end of the day, it's her bday, so I let her.  With respect to others, I don't second guess why/how others come up with the invite list - partly just lazy, I don't want to think about it. But also, ultimately, it's their party, their resources, they get to do what they wish - I truly don't want to be the arbiter on how others should throw a party.
Â
Not being invited:
Same rationale - I really don't want to know how/why they invite whomever - life is short, the clock is ticking, and all that. DD has been all over the map of being invited/excluded, not inviting/excluding etc. No, I didn't like it when she vehemently refused to invite this one kid from her class - we ended up negotiating about it. And, yes, it hurt DD when she found out not being invited. But all in all, things blew over pretty quickly. It probably bothered me longer than it did her ... :)
Â
One thing I've learnt, at least for my DD, she picked up cues from me in terms on how to respond. If I don't make it a big deal - in most cases, she won't make it a big deal either.
Â
In terms of at what age bday parties get complicated - I suspect it basically starts at whatever age bday parties start. Around here, that'd be around 3-4 yrs old, when lots of kids go to preschool.