The law likes to sort issues into pigeon holes, often with the use of a large sledgehammer to overcome the natural resistance to the particular hole.
I have been in the audience when the High Court hearing a JR against refusal to state a case reconvened itself as a Divisional Court (without flinching) to determine the substantive issue.
Either way, the prosecution is (on the face of it at least) unlawful, but the court would need to satisfy itself of the fact before deciding that it cannot continue to try the information. I have it in mind that technically it is an abuse of process - which used to require an application for stay to be lodged at least 14 days before the trial date, but no longer does, but the bottom line is that the issue needs to be communicated to the court and the other party in good time, and the court needs to determine whether it would be lawful to continue the proceedings.