Molly didn’t have to answer the door with Rosie in her arms. The baby was not upset or sad, there was no reason she couldn’t have put her down (if she was even holding her to begin with) to answer the door.
But this is Molly Hooper.
She had to give Sherlock the most awful message from John. She is loyal to both of them, but she is not heartless. She is compassionate and understanding and above all loves them fiercely.
So she gave Sherlock a moment with his goddaughter. He had to hear that message but she let him see Rosie to soften the blow, to tell him that she didn’t agree with John. She would respect his wishes, but do her best to be there for Sherlock, too.