No finding, sentence, or order passed by a Court of competent jurisdiction shall be deemed invalid solely on the ground that no charge was framed, or due to any error, omission, or irregularity in the charge, including any misjoinder of charges, unless, in the opinion of the Court of appeal, confirmation, or revision, a failure of justice has been caused thereby.
If the Court of appeal, confirmation, or revision determines that a failure of justice has occurred, it may:
Provided, however, that if the Court concludes the facts of the case are such that no valid charge could be framed against the accused based on the proven facts, it shall quash the conviction.