This is called a "Directed Verdict" and exists in all cases where a jury trial is present. A judge can make a directed verdict at any time up to and including the return of the verdict from the jury and the reading of the verdict in the court.
A directed verdict can only be made in the defendant's favor (A Directed Verdict finds the defendant not guilty is the only option) and may be one of the few grounds for appeal available to the prosecution. Typically the judge makes them when they feel that the evidence presented is insufficient for any reasonable jury to convict the defendant.
Although I wasn't able to find a U.K. procedures, I was able to find procedures in the U.S. Typically the first time this will happen is when the Prosecution Rests their case, the defense may make a motion for a directed verdict which allows the judge to rule on if one or more of the charges are dropped as the judge reasons the prosecution did not present evidence to convict.
The judge may also make a directed verdict at any point after the jury has received the case up to the point where the jury announces the verdict. Typically this occurs in civil suits when the jury awards damages in excess of legal limits, at which point the judge will alter the damages awarded to the maximum limit set by law (This was the case in the Depp v. Heard defamation case, where the jury awarded Depp punitive damages that were higher than the limit for such damages one could be awarded for Defamation by Virginia Law) but they do occur in criminal cases (typically the judge will not issue directed verdicts because they are hoping the jury realizes they shouldn't convict, and but the judge will if the jury some how convicts anyway.). Typically, in these are matters of law, not matters of fact (the jury deliberates on the facts of the case). For this reason, they are usually entered as "Judgements as matter of law" which basically says "the law says this isn't a crime, so not guilty of a crime".
In the U.S., a directed verdict entered after the jury receives the case for deliberation is one of the few times in U.S. law that the prosecution may initiate the appeals process.