If the defendant was formerly acquitted on the ground of variance between the accusatory pleading and the proof or the accusatory pleading was dismissed upon an objection to its form or substance, or in order to hold the defendant for a higher offense, without a judgment of acquittal, it is not an acquittal of the same offense.
Ca. Pen. Code § 1021