What happens if I leave federal service for retirement or other reasons with an outstanding loan?
The rules are complex. Essentially, if you do not repay the loan in full at separation, a “taxable distribution” will be declared on the portion of the outstanding balance that is ordinarily taxable on withdrawal. That includes traditional balances, and Roth balance earnings that are not “qualified” for tax-free distribution.

Money you invested into a Roth balance and its qualified earnings would not be taxable, however. In addition, there may be a 10 percent early withdrawal penalty on the taxable portion.