Qitzur Shulchan Arukh – 180:12-13
Someone who comes [to collect] on the strength of [a claim by] a non-Jew, he is like a non-Jew. Therefore, if someone buys from a non-Jew a debt contract on a Jew, it does not retire [at shemitah] for the non-Jew could have collected on his contract forever.
Similarly, someone who cosigned to a non-Jew on behalf of a Jew, and the Jew didn’t pay, requiring the cosigner Jew to pay the non-Jew and collect from the non-Jew the contract on the borrower, the loan doesn’t retire. But if there was no contract, but he collected for his friend orally and now he had to pay [the loan] off for him to the non-Jew, he would not be obligated [after shemittah to repay the cosigner].
The seventh year does not retire loans except at its end. Therefore, someone who lends his friend money during the shemittah year itself, he can collect the entire year. And when the sun sets on erev Rosh haShanah, the obligation is lost.
In se’if 12, the contrast between having a contract and not having a contract appears to be as follows:
If the loan had a contract, then there is a piece of paper being handed from the non-Jew to the cosigner. That paper has value, the power to collect forever, since it was created for a loan involving a non-Jew.
If there was no contract, then effectively the lent the original borrower money when he paid the non-Jew on his behalf. This is then a second loan, one between two Jews, and thus shemittah applies.