First time KD thought that his client was innocent and the judge pronounced judgement freeing KD's client. Later KD found that his client was actually guilty. Then the judge overturned his earlier decision. Isn't it the job of the judge to listen to all the arguments, listen to the witnesses, see the evidences and then make correct judgement?
Simiarly, in the episode which had Sweta Tiwari in it, initially the judge freed KD's client and, then he changed his decision because KD said so.
In some of the episodes it has been shown that the judge did not make wrong judgement but he was going to make when KD stopped the judge.