Referees and guarantors are essentially different:
The witness only proves the authenticity of the lending behavior of both parties. If the borrower is unable to repay the loan at that time, it has nothing to do with the witness, and the lender should still claim the rights from the borrower.
The guarantor needs to bear the corresponding guarantee responsibility according to the provisions of the guarantee law. If it is a general guarantee, the guarantor shall bear the responsibility when the debtor fails to perform the debt; Where it is guaranteed by joint and several liability, the creditor may require the debtor to perform the debt, or may require the guarantor to assume the guarantee liability within the scope of its guarantee.
Further reading: How to buy insurance, which is good, and teach you how to avoid these "pits" of insurance.