That is a good point - if the Jedi hadn't attacked Palpatine and been willing to work with/for him as they had been for the previous decade and just continued to take orders from the senate then not only would Palpatine have no justification to issue Order 66 he might not even have wanted to, if the Jedi were more loyal to the systems of the Republic they might have avoided a lot of hardship.