Allow Us To Explain
As you're about to see, there are many reasons why a writer or director might want to change the gender of a character mid-production: a change in actor, a change in social mores, or simply a sudden good idea. To our mind, it almost always makes the character more interesting if you know that their particular personality was considered fine for any gender. With many of these characters you also have to wonder: would their character arcs have been different if they'd stayed the originally planned gender? Would Ripley have had a love interest, would Dory and Martin had some on-screen chemistry, would Luke and Han have remained just friends? Gender roles aren't so rigidly defined as they once were, and thank goodness for that.