Regarding the notice, the gender would have been known by the medico people and even the palace prior to the birth no doubt.
The ultrasound scanner would doubtless have had some idea, but if it had been more widely known, there would probably not have been the rather unseemly rush to get the order of succession changed.
The duchess also accidentally referred to her unborn as 'her' rather than 'it'. Prospective parents often give their unborn babes temporary names, and in this case it would appear to have been a female one. Had they known the gender, that would almost certainly have changed..
I may be drunk, Miss, but in the morning I shall be sober and you will still be ugly - W.S. Churchill