the thing is whether it’s right or wrong, or whether you agree with it or not. In many ways the framers of the constitution gave the president nearly unlimited power, more or less an elected king. The only limitations being the powers expressly given to congress and the courts.
the court may be forced to read between the lines and effectively add to the constitution and say that a president “could” lose immunity if they are removed from office by impeachment.
I am not sure they will go that far though.
The decision to prosecute a sitting or former president is inherently a political decision. The Constitutiion lays out the process to be followed.