In s03e01 of The Flash, Barry has created an alternate timeline wherein he is happily living with his parents.
When he returns back to the original timeline (one in which his mother is dead), he tells his friends about their doppelgangers from that alternate timeline.
He tells John Diggle (from Arrow) that he had baby John in the alternate timeline, and not baby Sara (as in the current timeline).
Now, we know that everyone has a doppelganger in every different timeline ever created. In this specific case, how come the baby's gender got changed?