Retirement plan

Has anyone taken a loan from their retirement plan to purchase a home? Do you recommend it? Or have any insights?

I am thinking of borrowing from my 457b to purchase/rehab a duplex using househack strategy. Once I refinance within 6 to 12 months, I will pay it back in full.

Thank you!