Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:5:108

That is more likely that they will give testimony according to its ˹true˺ objective, or ˹at least˺ they would fear that ˹other˺ oaths might be taken after their oaths. And fear Allah and listen; and Allah does not guide the defiantly disobedient people.  

That, ruling mentioned, where the oath devolves to the inheritors, ˹makes it˺ likelier, brings closer ˹the eventuality˺, that they, the witnesses or the trustees, will bear the testimony in its true form, ˹the form˺ in which they have been charged to bear it, without distortion or breach of faith, or, it is likelier, that they will be afraid that after their oaths other oaths may be taken, from the inheritors, the plaintiffs, who would swear to the two men’s breach of faith or perjury, in which case they would be disgraced and would incur penalties, and so ˹because of this˺ they will not lie. Fear God, by refraining from betrayal and perjury, and listen, to what you have been commanded, listening in acceptance. God does not guide the wicked people, those rebelling against obedience to Him; ˹He does not guide the wicked˺ to the way of goodness.
القرآن:٥:١٠٨

ذَٰلِكَ أَدْنَىٰ أَنْ يَأْتُوا بِالشَّهَادَةِ عَلَىٰ وَجْهِهَا أَوْ يَخَافُوا أَنْ تُرَدَّ أَيْمَانٌ بَعْدَ أَيْمَانِهِمْ ۗ وَاتَّقُوا اللَّهَ وَاسْمَعُوا ۗ وَاللَّهُ لَا يَهْدِي الْقَوْمَ الْفَاسِقِينَ  

{ذلك} الحكم المذكور من رد اليمين على الورثة {أدنى} أقرب إلى {أن يأتوا} أي الشهود أو الأوصياء {بالشهادة على وجهها} الذي تحملوها عليه من غير تحريف ولا خيانة {أو} أقرب إلى أن {يخافوا أن تُرد أيمان بعد أيْمانهم} على الورثة المدعين فيحلفون على خيانتهم وكذبهم فيفتضحون ويغرمون فلا يكذبوا {واتقوا الله} بترك الخيانة والكذب {واسمعوا} ما تؤمرون به سماع قبول {والله لا يهدي القوم الفاسقين} الخارجين عن طاعته إلى سبيل الخير.