There is an exception to the penalty tax if the distribution was used to pay medical expenses, but not specifically for a birth of a child.
The medical expenses would need to be over 7.5% of your Adjusted Gross Income (AGI)
The link references a 401k loan. I took an early distribution. There is an exception in TurboTax for birth or adoption of a child. Not certain your answer applied to my question.
Yes, there is an exception to the 10% penalty for "distributions up to $5,000 that are made to you from a defined contribution plan if the distribution is a qualified birth or adoption distribution" (IRS).
"A qualified birth or adoption distribution is any distribution from an applicable eligible retirement plan if made during the 1-year period beginning on the date on which your child was born or the date on which the legal adoption of your child was finalized" (IRS)
It seems your distribution was too late to qualify.