Not a registered investment advisor, but I think you have to wait 5 years before you can withdraw up to the contribution amount in the Roth. Otherwise same idea.
I pulled this off a Schwab website. Not sure if I am interpreting it correctly but it appears to say that you can withdraw your contributions without regard to the 5 year point but any EARNINGS withdrawn before that 5 year point will be subject to that tax and penalty. Of course the only reason you would do this is that you have a huge loss and therefore you would not have any earnings.
Bold words are my emphasis.
=====
Age 59 and under.
You can withdraw
contributions you made to your Roth IRA anytime, tax- and penalty-free. However, you may have to pay taxes and penalties on
earnings in your Roth IRA.
Withdrawals from a Roth IRA you've had less than five years.
If you take a distribution of Roth IRA
earnings before you reach age 59˝ and before the account is five years old, the
earnings may be subject to taxes and penalties. You may be able to avoid penalties (but not taxes) in the following situations:
You use the withdrawal (up to a $10,000 lifetime maximum) to pay for a first-time home purchase.
You use the withdrawal to pay for qualified education expenses.
You're at least age 59˝.
You become disabled or pass away.
You use the withdrawal to pay for unreimbursed medical expenses or health insurance if you’re unemployed.
The distribution is made in substantially equal periodic payments.1
===========
In my case in 2008 I don't think I had the Roth for more than 5 years ... but I could be mistaken...that was a long time ago. I do know that I closed the account (it was the only roth I had) and claimed the loss and did not get in trouble with the IRS...but maybe that was luck? I do know I researched that capability and a lot of financial web sites said you could do that...so I did.