i believe mace windu couldn't have killed sidious, even if anakin hadn't stopped him, because mace windu isn't the chosen one (here's a good meta on this topic). however, even if we imagine a situation in which mace windu does kill the chancellor, many people imagine some rosy fix-it scenario where nothing bad happens, everyone is happy, the jedi order continues to thrive, and the republic suddenly becomes the perfect place to live in — 'and they lived happily ever after', basically. and i don't want to disappoint anyone, but there's no way that could have happened. here are some of my thoughts on the matter:
at the time of revenge of the sith, the jedi order had a pretty bad reputation, while chancellor palpatine's was practically perfect. palpatine had virtually unanimous support in the senate, he was constantly granted more and more emergency powers, and the people applauded to the rise of the empire. almost the entire gffa considered palpatine a responsible and wise leader who always acted in the interests of the people. so what would happen if the republic suddenly learned that the jedi had assassinated their beloved chancellor in his own office? well, nothing good, really.
the only proof mace windu received before storming his office that chancellor palpatine is lord sidious is anakin's words about him knowing a lot about the force and the dark side. sure, there are surveillance cameras that captured palpatine fighting the jedi masters and even killing three of them, but those same recordings will also contain footage of the chancellor begging for mercy, as he is 'old and weak and unable to defend himself', so in the eyes of the people of the republic, this recording would look like betrayal on the part of the jedi, not the chancellor. 'but palpatine is a sith lord, this will surprise people!!' you might say and you'll be right, but there's one big problem with that: the force is a mysterious phenomenon that almost no one believes in, and no one in the galaxy knows what a 'sith' is or why being a sith is so bad, so in the eyes of the republic, the jedi simply wouldn't have had a compelling, justifiable reason to kill chancellor palpatine
and let me remind you that sidious continued to play the good guy and the victim even during his arrest: he happily asked mace windu about grievous's death, even though he understood from the start why they were there; he called his arrest a 'treason' on the jedi's part, and then he began to play the role of an old, weak man whom the jedi were disfiguring with their incomprehensible magic. and i'll also remind you that palpatine has a ton of supporters and allies in the senate who could easily justify palpatine by claiming that the jedi had no right to arrest him, that his affiliation with the sith was his own business (in the novelization, palpatine says that there is freedom of religion in the republic, meaning that affiliation with the sith cannot be grounds for arrest and would most likely be considered illegal lmao), and that all of this was self-defense. the chancellor's reputation was on his side: he was loved and supported throughout the republic, which means people will be more likely to believe the version of the chancellor's assassination that portrays him as the biggest victim
and by the way, the jedi might not even get those security footage: if some mas amedda or sly moore had gotten to them first, the jedi council would have had no way to explain or justify their actions
another issue is that the chancellor has been playing both sides since the very first day of the war and is himself a traitor to the republic, secretly leading the separatist army, which is the main reason the jedi wanted to arrest/kill him in canon. however, there's a huge problem here too: the jedi had no evidence that palpatine was playing both sides, and it's unlikely such evidence would have been obtainable. none of the separatists, except count dooku, knew that chancellor palpatine was darth sidious. sidious conducted all interactions with the separatists through trusted confidants, kept direct contact to a minimum, and used secure communication channels, so obtaining evidence that he was secretly aiding the separatists, much less being their secret leader, would have been simply impossible
thus, it can be understood that if the jedi had successfully killed the chancellor, it would not have magically restored their reputation, but rather a real nightmare would have begun in the senate, and it remains to be seen how this would have affected the already terrible state of the republic, and the actions of the jedi would be perceived as treason against the interests of the republic
now let's remember order66 and how, for clones, it's just one of 150 standard emergency protocols
order66: 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.
in addition to this order, both canons also contained orders that in the event of the chancellor being incapacitated, overall gar command shall fall to the vice chair of the senate until a successor is appointed, which means there would be absolutely nothing stopping mas amedda from giving the order66 himself. palpatine's closest allies in the senate knew about his plans to form an empire and destroy the jedi order, and some of them even knew about his affiliation with the sith and the separatist army, and were completely in agreement with this plan — so, what do you think would have prevented mas amedda, sly moore, palpatine's allied senators, grand moffs like tarkin, and so on from completing his plan? it's unlikely that everything would have gone as smoothly as in canon, but i'm honestly tired of people pretending that killing palpatine would have meant the end of everything bad and the beginning of everything good, when in reality, he had a ton of supporters and allies who supported his point of view in everything, and chaos would have erupted in the senate and throughout the galaxy because of those people too; without the death of the separatist leaders and the disabling of the droid army (in canon, this was done by vader on sidious' orders), the civil war would have dragged on for much longer; and the chances that the jedi order would have been similarly destroyed were sadly very far from zero
honestly, the only way to stop order66, the civil war and the chaos in the republic in that scenario was for the jedi to arrest all the senators and temporarily seize power, which, ironically, is the very argument sidious used to finally convince anakin of the need to destroy the order
i remember reading a fanfic where yoda and obi-wan return to coruscant early, and supposedly this saves the entire galaxy and the jedi order, and the evil bad anakin skywalker is sent to a military prison for treason, and supposedly the entire republic was disappointed in him and saw him as a traitor and a villain. do i even need to say that such a scenario is nonsense? and i'm not saying this from the perspective of 'anakin doing everything right and he should be patted on the head for it', but like, really. this would never have happened. whether you think anakin deserved that ending or not, it simply would never have happened in canon because if it had happened, people would have reacted the opposite way and hate the jedi, which would be very unfair, but like, that's exactly what would have happened, sorry🤷🏼♂️
the political situation in rots was extremely complex, and one could speculate about what would have happened if this or that character had made a different choice. but as padme said, by that point, the republic itself had become the evil they were all fighting against. of course, anakin's actions in the film can't be justified, but i'm just so tired of people seriously claiming that one guy's choice destroyed the thousand-year-old republic or that the marriage and some sex between two young adults was to blame, like, again. nonsense.
if anakin hadn't agreed to become palpatine's apprentice in his office, he would have been killed; if he'd tried to stop order66 before reaching the temple, he would have been executed by the clones for treason; and if anakin hadn't stopped mace windu from killing palpatine, there would have been no happy ending one way or another, because it is a tragedy — the situation was super extreme, and anakin chose the lesser of two evils, as it seemed to him, and decided to be selfish and save padme at the cost of selling his soul to the devil and getting his hands dirty in blood. anakin's fall ruined his life in the first place. at the last moment he entered into someone else's plan, which could no longer be stopped. anakin is late to the party! actually, anakin is so late that sidious and his allies have already finished dancing. anakin is literally cleaning up the party.
my point is, by the time of rots, there was nothing that could be done to save the situation: this could have been done in aotc or tpm, or if the republic's system had been deemed obsolete and changed before the events of the prequels. however, by the time of rots, it was simply impossible to save the situation, to really save it and make the ending not tragic and truly happy. imo, in a scenario where palpatine dies before the formation of the empire, the galaxy enters a strange period where the dictatorship has not yet formed, but the republic is already de facto dead and a desperate race for power in the senate takes place, while the jedi order is either officially disbanded or a strange version of order66 occurs, in which there are fewer casualties, but they are still catastrophic — the situation is a slightly better than in canon, but still, overall, terrible
or maybe i'm just not optimistic enough, tell me what you think