Doesn't work that way. Monies withdrawn from a Coverdell/529 plan must be used to pay for "qualified" education expenses in the same tax year they are withdrawn. If not, then the withdrawn amount is taxable income to the beneficiary recipient named on the 1099-Q. So any "earnings" you may get by letting the money sit in the account, will be lost to taxes if not used to pay qualified education expenses in the tax year those funds are withdrawn.
Paying a loan of "any" type is not a qualified education expense for 529 funds.
The only qualified education expenses for 529 funds are tuition, books, lab fees, and room & board. That's it, and there are no exceptions.