technically speaking, you can try to unlock it again. with some luck, you might be able to reverse the process and un-brick the phone.
legally speaking, you are in a contract dispute with the buyer. what you should have done is not taking the phone back. but since you took it back already, then you probably have to refund the money. otherwise, the buyer may have an "unjust enrichment" claim against you. of course. of course, you can argue that he did not return the phone to you in "original" condition. you two can fight all the way to the court, but that would not help resolving the problem.
i would try to rescue the phone first.