What pronoun can I use for baby when it is not clear whether it is he or a she? Is 'it' OK?
There's nothing wrong by address a baby by using 'it'. Although accepted by many, some people might find it to be dehumanizing. In some cases, certain people might even take offence if you address a baby with 'it'.
By doing a little dig around the internet, I found that referring to a young child as 'it' is far more common in BrE than AmE, although the usage is dying out.
The fact is that parent might take offense, but that doesn't mean it's not a standard construction.
If you want to avoid a situation like that, you could cleverly modify the sentence to make sure they don't get offended.
You can use either a 'he' or 'she', and you have a 50% chance of getting it right (good odds!). Even if you get it wrong, they'll correct you and mostly won't take offence. You could apologize if they correct you. That should nullify any damage you may have caused.
You could simply ask them. It may seem awkward, but there's nothing wrong with it.
You could cleverly reconstruct the sentence, and avoid using a gender pronoun. Although not possible in all scenarios, but it's one option.
You could just address the infant as 'baby'. Replace all gender pronouns with the word 'baby'. It may sound redundant, but sometimes it's safer to take the high road than to accidentally offend anybody. For example: "The baby is crying. The baby must be hungry".
A few good reads: