Of course debt between countries(or people or corporations) can cancel each other out. That is the basis of trade. As long as the same principle players are involved. Country A buys American corn from the agriculture department and sells agriculture chemicals back to us. We may choose to offset each other and the bigger debtor can just pay the difference or ask for it to be held as a debt until they can produce more product- no problem. Only problem is that the word “country” is too big. If the Agriculture department is owed money but the tourism department or the military gets the repayment benefit, it does not offset.
Of course debt and repayment can be handed around in a circular fashion like described. That is all money does anyway, it serves as a visible representation of the value of your services or products so you can exchange. All money is, is a promise to pay.
They could just as easily have written each other a check and then take all the different checks to the bank and then the banker figures out it is all a wash. This works because each member of the circle has alreafy produced his labor. Nowhere in this circle is there a person who borrows the money without producing, thus breaking the cycle.
You cannot just hand it off to another person who has not yet performed his part and pray that he shows up though. In the scenario it works because each player had already previously provided a valuable product or service of acceptable equal value. The note was not given to anyone who was promising to deliver at a future date.