401k interest rate does pay back to your account. So it is a very credible way to access much needed money.
Even if PMI is deductible, remember you will only get a portion back (say 30% if that is your tax rate).
of course, the portion of the 401k you remove from the account will not be in the market generating passive income.
however, if we are merely looking at a one time loan that will be paid back rather quickly within 1-2 years, I don’t think that would be of significant issue for you. the stock market is unlikely to go anywhere dramatic over the next couple of years.