South Korean president is jailed for trying to coup, no? So there’s precedent.
This is called upholding the constitution and it’s fundamental for a democracy. If you say president is immune, you get current US.
And even most leftist woke socialist president between probability of a prison for himself and the current US will choose current US.