There are other bases for a motion to dismiss.
For example, a motion to dismiss with prejudice can be based on egregious prosecutorial misconduct that irreparably damages the defense (in MA). I'd have to go digging to check on what you suggest. I have never seen a case and do not know anyone who has where the government moved to dismiss charges after a guilty plea but before sentencing. I do appeals, so my job is getting someone a new trial. I haven't yet had a case where I had a viable basis to try to convince the government to
dismiss charges, and with the way legal research goes, you generally figure out the specific mechanics of something only when it is relevant to your case. So for example, I might vaguely know that evidence should be suppressed if the government discovered it only after entering the curtilage of one's house without probable cause, but I couldn't speculate about how a specific case would work out since I haven't had to research that in a good eight years or more.
There are cases where the defense can prove innocence in a later motion for new trial, the government if convinced will then not object to the relief and also move to dismiss charges. Innocence project stuff. ie,
Charges Dismissed Against Chicago Man Convicted Due to Police Misconduct
So, bottom line: there definitely
is a mechanism. I just haven't had to research how exactly it needs to be framed.