Mitzvah 411) That a witness should not judge a case involving a possible death penalty in which he himself testified
“And one witness should not call out against a soul to die!” (Bamidbar 35:30)
It is a negative commandment that when a man testifies in a case which involves a possible death penalty, he must say no more than his own testimony, even if he is an understanding and wise man, as a witness may not become a judge in life and death cases, as it says “And one witness should not call out against a soul to die!”. The reason for this is that it looks like he is not impartial in his testimony. This law only applies to cases involving a possible death sentence in which he may not call out for prosecution or defense.
Amongst the roots of this commandment are that cases involving death are very difficult and need very careful attention to detail, and the judges have been commanded to find any way possible to save the accused (not G-d forbid that they should pervert the course of justice, but that they should endeavor to find a legitimate reason to pardon him), and we have therefore been commanded not to allow the witnesses to be involved in the judgment as maybe since they saw the act themselves they will be unable to try and pardon him as they will want to find him guilty.
This commandment applies to men when the temple was standing and the great court was sitting in its fixed place in Yerushalayim, as only in these circumstances do we judge capital cases.