When, at the close of the prosecution's evidence or at the close of all the evidence, the evidence is insufficient to support a finding or verdict of guilty, the court may, on its own motion or on the motion of the defendant, dismiss the action and discharge the defendant. However, prior to dismissal, the court may allow the case to be reopened for good cause shown.
§ 46-16-403, MCA