Makkos 1:4-5
Makkos 1:4
Witnesses are not condemned for being false witnesses until they themselves are testified against. For example, let’s say that they testified that one person killed another. Other witnesses come and say that their testimony is impossible because they were with the victim or the accused elsewhere at that time in question. In this case, the first witnesses are not condemned as false witnesses. However, if the second witnesses testify that the initial testimony is impossible because the first witnesses themselves were with them elsewhere at the time in question, then they are condemned as false witnesses and executed for their testimony.
Makkos 1:5
If additional witnesses come and give the same testimony as those proven to be false and these are also proven to be false (by the same contradicting witnesses), and then still more witnesses come and are proven to be false witnesses – even if this happens 100 times, they are all executed. Rabbi Yehuda says that if this happens, some sort of plot is afoot and only the first witnesses are executed.