What? Have we gone from "The Jedi were caught off guard" to "The Jedi were kinda responsible" to "The Jedi were corrupt"? The prequels never say or show that the Jedi had an active role in the events that happen in ROTS. If anything, all 3 movies clearly show that it is Sidious who has orchestrated everything, as you very well said, with the Senate and the politicans being clueless sheep. The Jedi couldn't figure it out, but their hearts and minds were in the right place. You can't blame the innocent who were slaughtered and purged as being the perpetrators not even by a bit, when they were the victims, and nothing but the victims, of the scheme. The fact that the Jedi Code was not perfect doesn't mean that it was the reason of their undoing. The reason was the Sith, who did the undoing. And Anakin's fall to the dark side was not because the Jedi failed him, as Obi-Wan famously cries out. His fall to the dark side is because he completely ignored the Jedi teachings, got married in secret, lied to all the Jedi, was unable to control his feelings, and got seduced by the Emperor. And I don't take anything that Luke says in TLJ seriously, cause that's not even Luke to begin with. Given the torch by Yoda and Kenobi to establish a new Jedi Order in ROTJ, but then magically reappears in TLJ as an amalgam of Qui-Gon, Anakin, Sidious and various disgruntled Jedi from the Legends novels, such as Kyp Durron.