Negative commandment · Lo Ta’aseh #291 of 613
For a witness not to render a decision in a capital case in which he testified
שלא יורה העד בדין שהעיד בו בדיני נפשות
The verse · Bamidbar 35:30
כׇּל־מַכֵּה־נֶפֶשׁ לְפִי עֵדִים יִרְצַח אֶת־הָרֹצֵחַ וְעֵד אֶחָד לֹא־יַעֲנֶה בְנֶפֶשׁ לָמוּת
“Whoever kills any person, the murderer shall be put to death by the mouth of witnesses: but one witness shall not testify against any person to cause him to die.”
The Rambam’s words
For a witness not to render a decision in a capital case in which he testified, as [Numbers 35:30] states: "One witness shall not testify in a capital case..."
שלא יורה העד בדין שהעיד בו בדיני נפשות, שנאמר "וְעֵד אֶחָד לֹא יַעֲנֶה בְּנֶפֶשׁ" (במדבר לה, ל).
Why · Sefer HaChinuch #411
That the witness not issue a ruling in the case that he is testifying about in capital punishments
“It is from the roots of the commandment [that] since the matter of capital punishment is a very weighty thing (Rosh Hashanah 26a) which requires the greatest of precision, and the community has been commanded to save the accused with everything that is fit to save him for his sake — not that they pervert the judgment in order to save him, G-d forbid, and like they, may their memory be blessed, expounded (Rosh Hashanah 26a, connecting the two phrases in Numbers 35:24-25), “And the community shall judge, And the community shall save,” meaning to say that they need to search for his merit and if he has a merit, they should save him, and if not, he should be killed — therefore, we were warned that the judgment should at the very least be brought before the court.”
Who & when
“And this commandment is practiced by males alone and at the time of the Temple with the Sanhedrin in their place, as then do we judge capital punishments, but not at another time.”
Where in the Mishneh Torah
Hilchot Testimony הלכות עדות