“Length of gestation. The average length of human gestation is 280 days, or 40 weeks, from the first day of the woman’s last menstrual period.” (betterhealth.vic.gov.au)
What is it about the number 40? This number occurs many times throughout the Bible. Flood was forty days and nights. Fasting by Jesus and Moses and Elijah was forty days. Moses did it three times without food or water (Exo 24:18; Dt 9:9; 9:18,25; Dt 10:10; Exodus 34:28). Israel spied the land for forty days. Israel wandered in the desert for forty years. Moses’ life is broken up in 3 forty year periods. 40 years in Egypt. 40 years in Midian. Forty years leading Israel in the wilderness. God provided manna bread for Israel for forty years and for forty years their clothes did not wear out (Dt 8:4; Ex. 16:35). After the conquest, Israel was undisturbed by enemies for forty years. After that, due to unfaithfulness, God put them under Philistine rule for forty years. Eli judged Israel for forty years. Goliath challenged and taunted Israel for forty days before young David answered the challenge. God gave Nineveh 40 days to repent before it was destroyed. King Saul, King David, and King Solomon each ruled for forty years. Jesus was tempted for forty days. Jesus presented Himself alive for forty days after the resurrection.
I don’t know that the 40 weeks human gestation period has any bearing, but the repetition of that number is very curious. Most experts of the Bible agree that the 40, whether it be for days or years, means a time of trial or testing or preparation, Deut 8:2; Josh. 5:6. What better analogy could there be that a woman carry a child in the womb for forty weeks!