The Messenger of Allah ﷺ said, "The testimony of a treacherous man or woman is not valid, nor that of someone who has had a hadd punishment carried out against them in Islam, nor that of a person who harbors a grudge against his brother."
حدثنا أيوب بن محمد الرقي حدثنا معمر بن سليمان ح و حدثنا محمد بن يحيى حدثنا يزيد بن هارون قالا حدثنا حجاج بن أرطاة
قال رسول الله ﷺ لا تجوز شهادة خائن ولا خائنة ولا محدود في الإسلام ولا ذي غمر على أخيه
Source assessment, its chain of transmission is daif. Ahmad recorded it, 2/208, from Yazid bin Harun and others through it. See also numbers 496 and 1129 for its defect. It has daif corroborating narrations, but the basic hadith is sahih with the wording, "The testimony of a treacherous man or woman is not permissible, nor that of a fornicator or fornicatress, nor of one who bears resentment against his brother." Abu Dawud recorded it, number 3601, and others, and its chain is strong, as Hafiz said in al-Talkhis, 4/198, and the hadith has corroborating narrations.