If the percentage of earnings is capped (as it was in most agreements), it's far better than a loan-- worst/best case you pay the capped amount (like the loan amount); if you do worse than that best case, you pay proportionally less.
But trying to claw earnings from jobs that didn't relate to the school violates the letter and spirit of the agreement and shows the disproportionate power of the parties.