Chattel slavery was banned, but indentured servitude (a form of debt slavery) was still legal in the British Empire. After the British Empire ended chattel slavery, they turned to indentured slavery. While most chattel slaves were previously from Africa, the British Empire got most of its new indentured slaves from India.
In other words, he was an indentured slave in England, rather than a chattel slave. That's why he was released as soon as he paid off the debt. Indentured slavery was also around in North America up until the early 1900s, long after the abolition of chattel slavery.