I have not looked into this part of ERPNext ever, so I am just guessing
when just take the logic of the error message “Cannot Pay to Customer without any negative outstanding invoice” I’d say you have to find a way to create such a ‘negative invoice’ through the referral they are making.
Also there is a term “Sales Partner”, so maybe you have to utilize this. By default there does not seem to be a way to link a “Sales Partner” directly to a Customer though, neither it seems selecting a sales partner on a given Sales Order (which mentions a Commission % the Sales Partner is getting) create a liability in any way.
My guess … the base components of such a scenario are laid out in ERPNext already, but do not do anything in the accounting yet. But I’d be more then happy to be proven wrong.