If the evidence appears insufficient to charge the defendant with any offense, the defendant shall, if in custody, be discharged or, if the defendant has been released or deposited money in lieu thereof, the release agreement of the defendant is exonerated or the money of the defendant shall be refunded to the defendant; and in such case, the arrest of judgment operates as an acquittal of the charge upon which the accusatory instrument was founded.
ORS 136.525