It's fine, although it's possible a different expression might work better.
... in effect turning the debt into an interest-free loan.
I would also substitute "principal" for "amount lent", but this just personal preference. You could also say "amount loaned". There are other options:
You should only cancel the debt of a country if it has already paid off the original amount borrowed, essentially turning the debt into an interest-free loan.
The problem with "technically" is that, as it's commonly used, it means that what follows is true, but not necessarily relevant or useful to the context. For example:
As the young men ran around shouting to see if anyone could provide medical help, one of them pointed out Doctor Smythe crossing the quad. "Sir, you must come quick!" they called. "Peabody is dying!"
Smythe (who was a doctor of ancient Greek literature) responded in a measured tone. "Ah, well, yes, you see, technically I am a doctor, but I'm not that kind of doctor."
"In effect" instead suggests that what follows is the effective result of some action, rather than the original or intended result.