No... but it almost is.
If we are to take some Legends material into account, Order 66 was buried in a set of Contingency Orders for the Grand Army of the Republic that outlined protocol for a series of "what if" scenarios.
Order 66 states:
"In the event of Jedi officers acting against the interests of the Republic, and after receiving specific orders verified as coming directly from the Supreme Commander (Chancellor), GAR commanders will remove those officers by lethal force, and command of the GAR will revert to the Supreme Commander (Chancellor) until a new command structure is established."
Republic Commando: True Colors
The legality of how Order 66 went down hinges on whether or not the Jedi should have attempted to arrest <PERSON>. <PERSON> issued the order in response to <PERSON> attack and used it to claim that the Jedi were acting against the interests of the Republic, all of which appears to be executed legally assuming <PERSON>'s claim was true.
<PERSON> tells a convincing story and if your question involved him sticking to his guns, it's much harder to answer. But the phrasing of your question actually makes things easier. If in your hypothetical <PERSON> told the truth about everything, he would admit that the Jedi weren't, in fact, acting against the interests of the Republic. They were acting in response to the revelation that <PERSON> was the Sith Lord who was leading the Separatists. 503
That's very much in the Republic's best interests.
The attempted arrest of <PERSON> by <PERSON> was justified and while we don't know exactly what the Jedi's authority is, we can at least infer by his words that they had the right to make the arrest:
<PERSON>: In the name of the Galactic Senate of the Republic, you are under arrest, Chancellor.
<PERSON> and the other JEDI ignite their lightsabers.
<PERSON>: Are you threatening me, Master <PERSON>?
<PERSON>: The Senate will decide your fate.
Revenge of the Sith Script
While one might argue that the Jedi didn't have the authority to kill <PERSON>, I see no reason to make that claim. In the real world, if an officer is attacked, he is allowed to defend himself with lethal force (if necessary). In the absence of in-universe material stating otherwise, it's reasonable to assume <PERSON> had the same right. Especially with his friends lying dead on the floor next to him.
Interestingly enough, it wasn't illegal to be a Sith so that wouldn't have been the issue (though he would have lost a lot of credibility and support). The only real legal issue with <PERSON>'s actions is that he was leading the Separatists which is treason. If he were truthful about his involvement in starting and leading the war, <PERSON> was justified in his attack and Order 66 had no legal justification.
But <PERSON> fudged the details of the encounter with <PERSON>, masked his true role in the war by having the Separatist leaders executed, and then used those deceptions as justification for a perfectly legal process that allowed him to carry out the slaughter of the Jedi Order and the destruction of the Republic. 503