Nafi' narrates from Sayyiduna Ibn Umar (may Allah be pleased with them both): When the mukatab dies having paid part of his kitabah, and leaves wealth that is more than his kitabah, his wealth and whatever he leaves belongs to his master; his heirs will get nothing.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب المكاتب / 21684