This withdrawal could be considered an emergency. An emergency will allow you to make a withdrawal, still subject to tax, but without the 10% early withdrawal penalty. You can take one financial withdrawal emergency per year, not to exceed $1,000.
The IRS defines “emergency personal expense" as an unforeseeable or immediate financial need relating to necessary personal or family emergency expenses. (Section 115 of the Secure 2.0 Act)