First, you can always withdraw the original contributions into a Roth. The restriction is on withdrawing earnings. If you put in $5000 and it grows to $6,000, you have to leave in $1,000 but you can take out the original $5,000 without penalty.
Second, you can withdraw even earnings under certain circumstances and for certain approved purposes, like the first-time down payment on a home (up to $10k).
https://www.schwab.com/ira/roth-ira/withdrawal-rules#:~:text=but%20not%20penalties.-,Withdrawals%20from%20a%20Roth%20IRA%20you've%20had%20more%20than,are%20no%20required%20minimum%20distributions.
It's not at all a bad use of funds, even for the near term.