When it appears at any time before verdict or judgment that the defendant is prosecuted in a county not having jurisdiction of the offense, the court may order that all the papers and proceedings be certified and transmitted to the proper court of the proper county, and recognize the defendant to appear before such court on the first day of the next term thereof, to await the action of the grand jury. The witnesses shall also be recognized to appear at such court, that the prosecution may be proceeded with as provided by law.
§ 541.120, RSMo