All the hush-hush about Emma’s pregnancy could be explained by health concerns. The pregnancy isn’t far along, and Emma is getting into her forties. If there’s a problem with Emma and the baby, Hook would certainly want to protect both of them, and couples tend not to make the big announcement until they’re sure that they’re out of the early danger zone.
I don’t think the show will use this explanation now that Emma is out of the picture, but it’s what I’d think if it happened in real life.