If each arrival at the desk were an independent draw from the full class, then, sure, the chance of any given set of 9 arrivals having 9 women would be 1/512. (Though the chance of the sequence of 10 including 9 women and 1 man is 10/1024, or about 5 times more likely; by cherry-picking the set of arrivals to consider, you are añready making the set around you seem more unlikely than it is.)
Of course, if they were where independent the case, there’d also be a non-negligible case of a repeat in that set of arrivals; the fact that you chose a set in line at the same time demonstrates that they aren't a set of independent events. So the whole basis of your 1/512 even on the cherry-picked set is invalid.