all foetuses are by "default" females as the Y (male) chromosome is what ultimately defines a male. at around the 8th week of development an inherited Y chromosome starts to influence the developement with the production of the male hormone testosterone which then influences cellular development of male characteristics.
The Buddha is wise and benevolent and I agree with all you say.
To address the original statement by Mr Sensitive I would reiterate that a child's sex will be determined, as you say, by the presence or absence of the Y chromosome and, therefore, the testes rather than the ovaries are the important sites for sex determination. In summary, we start in the testes as much as in the ovaries.