Answered by Shaykh Abdurrahman ibn Yusuf Mangera
If someone stole some books from a school library in their youth, and then when they were older, they paid the school library in full for those stolen books thinking that the books had been given away. Some years later, one finds three of these stolen books that have been paid for – is one now obliged to still return these books to the school in question, or can one donate them to another school library?
In the name of Allah, the Inspirer of truth.
Libraries have a set system where they have stipulated charges for the many books that they loose. Since you paid these charges it is not necessary to return the books; they are yours. (See Radd al-Muhtar 3:210)
However, if you have no need for them then it may be better to donate them to the same library or to another one.
And Allah knows best.
Abdurrahman ibn Yusuf