A person who has taken part in a case as a judge, promoter of justice, defender of the bond, procurator, advocate, witness, or expert cannot later in another instance validly decide the same case as judge or perform the function of assessor.
Source: Code of Canon Law (Vatican.va)