I think it's a good general rule, but any story regarding gender is going to need specifically gendered characters to tell that story. Writing that kind of story off completely is needlessly prohibitive.
Even when gender is not the focus of the story, I feel that this risks "male default-ism" and sometimes erases femininity out of female protagonists. Not that women have to be feminine, but I find that fiction often defaults on that "girl boss™" trope to make women fit in the tropes of the genre they are in where male protagonists have traditionally solved all their problems with violence and kicking ass (I remember Lindsay Ellis complaining about that girl boss trope in a video essay but it's been a while).
I guess it comes back around to what you're saying, women in most times and places don't have the luxury of being able to ignore their gender. In such a setting, if you make your protagonist a woman, she's either going to have to be so much "one of the boys" that no-one acknowledges her as a woman... or the story is going to have to deal with gender in some way.
I disagree. There are too many challenges unique to being male/female to be able to write a convincing story without specifying the characters' genders. There are exceptions, of course.
Case in point, by having Ripley be a woman, there is an additional layer of depth in Aliens as to why Ripley's warnings of just how dangerous the creatures are mostly ignored by Burke/whoever it was, it's been a while since I've seen it.
That's not saying it wouldn't have worked with Ripley being a man, it would just be a slightly different story, because it would lack many subliminal themes of patriarchy, sexism, female hysteria, etc that having a woman as the protagonist allowed the story to more fully explore.
That said, there is a place for both gendered writing and genderless writing. It's all about the story you want to tell. Besides, without the concept or idea to try genderless writing, we may never have gotten Sigourney Weaver as Ripley, and that would have sucked.