Jesus obeyed God in all things, so we know He didn’t come up with his own idea to do this. God had His reasons for directing Jesus this way, and Jesus obeyed. So God’s will couldn’t have included letting His parents know, or Jesus certainly would have. That must have been an act of trust for Jesus, too. He certainly would have preferred to tell them, to sure they would not worry, if he went with His own preference. But He had to entrust their worry to God. He had to trust (hope?) that they knew He was doing God’s will. God’s will can sometimes be very painful to carry out.
Three days - foreshadows Christ in the tomb for 3 days.
Mary, who obeyed God in all things also, would also have been obeying God by not telling Joseph why she was pregnant. That left Joseph, after he noticed, in anguish for, I hear, 3 days, before the Angel of God relieved him with a vision. What anguish Mary must have felt, obeying God in silence while she knew Joseph suffered!