Another here agreeing with CommunistLegoBloc
Aside from the fact that it isn't unknown on occasion for parents to be told the baby is definitely one sex and then it turns out to be the other or for the parents to have a last-minute change of heart, I think it takes some of the enjoyment of actually meeting the baby away.
A newborn baby doesn't have an occupation, hobbies, known characteristics or likes and dislikes and doesn't yet have any anecdotes to tell about their life.
This is going to sound bonkers, but the only new information about themselves that they have to offer at that stage is their sex, weight and name and it's nice to have something to find out about them at the same time you first meet them. Knowing all of that (well, probably not the weight) beforehand is almost like stealing their thunder. Yes, I realise that the baby will neither know nor care, but I'm thinking from the pov of adults who are welcoming the new person into their family/social circle. I just think it's nicer to do all of the bonding/getting used to at the same time.
It might be a strange analogy, but it's a little bit like a wedding dress. The guests will have a very good idea of what kind of outfit the bride will be wearing, but most brides like the day of the wedding to be the first time people see the actual dress that they've chosen - being worn in the proper context on the significant day.
If you wouldn't go around showing everybody photos of you wearing your wedding dress in the shop in advance of the day (and if you would, fair enough), why ever would you introduce the name of your baby to them before you have the actual baby to introduce along with his or her name?