No there's not. When you have a loan which uses your 401(k) funds as collateral, when you leave that job the balance on the loan becomes due and payable within 30 or 60 days. If not paid in full, then the balance of the loan is taken from the 401(k) to pay off the loan. That withdrawn amount is taxable. If it's an early withdrawal it's also subject to the 10% early withdrawal penalty.