All true but if a grand jury decides to okay an indictment generally the judge doesn't just arbitrarily motion to dismiss the case before it ever goes to trial the way you were suggesting. Now once it actually goes to trial if the judge feels the prosecutor isn't making his case then he can motion to dismiss but this trial isn't even starting until sometime in December at the earliest. The biggest hurdle the DA has to overcome is proving that Trump was in on the decision to pay off the porn star and then disguise the payments as multiple smaller payments to his lawyer, which is exactly what David Pecker is there to testify to. Since it was his suggestion to do a catch and kill operation on the story that he discussed with Trump and Cohen.
There's nothing arbitrary about it. He is the judge. He will look at what the prosecutor has shown before the trial has started.. If he feels they have not shown a felony accrued he will dismiss. He will not allow a misdemeanor case to go forward IMO, especially with an ex POTUS. That is how all motions to dismiss work.
If anyone deserves jail time its turd. This is not the case that will put him there.