The High Priest and Sanhedrin condemn Jesus (meanwhile Peter denies Him), hand Him over for abuse and then to Pilate; Judas suicides: Mark 14:53–65; Matthew 26:57–68; Mark 14:66–72; Matthew 26:69–75; Luke 22:54–65; John 18:25–27; Mark 15:1; Matthew 27:1-2; Luke 22:66-71; Matthew 27:3–10
Were the trials of Jesus lawful by the standards of the day? The first two were held at night, without reliable witnesses, and in the private home (or homes) of Annas and his son-in-law, the high priest Caiaphas. It wasn’t unheard of (see Josephus for an example), and the aim, as with most trials, was to enforce a law and keep the social order intact.
The Sanhedrin did have the power to judge teachers, and by implication, false teachers.
Jesus condemned Himself by claiming to be the I AM and by claiming that He was the the Son of Man his judges/accusers would see seated in the place of power at God’s right hand and coming on the clouds of heaven. Since they didn’t recognise Jesus as the Messiah, he was blaspheming (and being a false teacher/prophet):
Then the high priest tore his clothing to show his horror and said, ‘Why do we need other witnesses? You have all heard his blasphemy. What is your verdict?’
‘Guilty!’ they all cried. ‘He deserves to die!’
He should have been stoned, according to some sources (which were written some time later), but the religious leaders’ fear of the people led them to hand Jesus over to the Romans for execution.
The legality of the so-called trial doesn’t matter in the end, since the final decision would be Pilate’s.