It's generally not practical to litigate this type of judicial error, because the legal/trial process moves faster than the appeal process. Judges are heavily biased against defendant at this stage of the process, and openly deviate from the law. Police, prosecutors and trial judges are a team, with close to zero probability of being penalized for violation of due process, as long as the violations aren't egregious, "shock the conscience" level.
You are correct. The actual proof or lack of same comes at trial. It is at the trial the State must prove their allegations. According to the Constitution, the defendant is not required to prove or disprove anything.