Praise be to Allah, the Lord of the World; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
The procedure you described is not valid and cannot be considered a way of giving Zakah, because Zakah embodies the connotation of giving and taking as can be understood from the verse: Allah Says (interpretation of meaning): {Take Sadaqah (alms) from their wealth in order to purify them and sanctify them with it, …} [9: 103].
What you did is more a cancellation of a debt. It does not include the form of giving to your friend and him taking from you. Again this constitutes a form of protection for your property.
So, if you cancel his debt with the intention of helping him and easing his matter, this will be highly rewarded.
Allah Says (interpretation of meaning): {And if the debtor is in a hard time (has no money), then grant him time till it is easy for him to repay, but if you remit it by way of charity, that is better for you if you did but know.} [2: 280].
If you cancel it considering it part of Zakah, this is invalid and you should pay the Zakah due on you to its legal recipients.
Allah knows best.