Shevuos, Chapter 4, Mishnah 11. This Mishnah too deals with a case in which the witnesses - the potential witnesses - are not liable for the oath of testimony.
The text of the Mishnah:
"Amar lishnayim: mashbia ani aleichem, ish peloni u'peloni, she'im atem yod'in li edus shetavo'u u'se'iduni" - a person administers an oath to two potential witnesses that they should come and testify on his behalf. "Shevuah she'einenu yod'in lecha edus" - and they swear that they do not know any testimony for him.
But "vehem yod'in lo edus" - in fact they do know testimony, and nevertheless they are exempt. What cases are we speaking about?
Testimony heard from another witness: the testimony they possess is not something they heard or saw themselves, but rather something they heard from another person.
"O shehayah echad mehen karov o pasul": one of the two witnesses is a relative of the litigant and is therefore disqualified from testifying, or they themselves are disqualified from testimony because of sins they committed, and consequently they cannot serve as witnesses.
"Harei elu peturin" - even though they swore, they are exempt, since in reality they were not valid witnesses.
The inference of Tosafos:
Tosafos point out that this law was already taught in the earlier Mishnayos: a witness must be fit to testify, someone who is able to serve as a witness. Tosafos therefore explain that our Mishnah is dealing with a situation in which there are three witnesses, two of whom are valid. Since one of them is disqualified, the rule applies to them: "edus shebatlah miktzasah batlah kulah" - testimony that has been invalidated in part is invalidated in its entirety. For this reason, even though only one of them is unfit, they are all exempt from the oath of testimony.
In summary: in this Mishnah we learned that witnesses who swore that they do not know any testimony, when in truth they did know testimony that is not acceptable - testimony heard from another witness, or where one of them is a relative or disqualified - are exempt from the oath of testimony, since in any case they were not valid witnesses. And according to Tosafos the Mishnah is dealing with three witnesses, and the disqualification of one of them exempts them all, by force of the rule "edus shebatlah miktzasah batlah kulah."