A judge slated the Crown Office and Procurator Fiscal Service as he threw out the case of an alleged stalker due to what he called systemic failings.
The trial at Kirkcaldy Sheriff Court was abandoned by Sheriff Alastair Thornton after it emerged witnesses had not been cited and evidence not disclosed.
Andrew Vettrino was due to stand trial accused of repeatedly contacting a woman by phone, text message and social media, threatening her with violence and repeatedly contacting her friends and family.
The 29-year-old, of Park Hill Wynd, Leven, was also alleged to have shown her mobile phone video footage of her undressed, taken without her consent.
He denied the charge and a further charge of acting aggressively towards her and two other women, threatening violence and challenging her to a fight.
Sheriff Thornton said: “The public and indeed the complainer are likely to be very concerned if the proceedings are brought to an end without a trial as a result of various and manifest failings on the part of the prosecution service.”
But he concluded the failings were “so significant” a Crown motion to adjourn for a third time must be refused and deserted the case.
“The failures appear to be systemic failings by the service,” he said.
A Crown Office statement said allegations of stalking are taken “extremely seriously” in recognition of the “devastating” impact stalking can have.
“We are committed to prosecuting such offences effectively and appropriately, and to supporting victims through the criminal justice process,” it added. “In this instance, however, it is clear that our standards have not been met and that is regrettable.
“We have already been in contact with the victim to explain what has happened and the Procurator Fiscal will be writing to the victim to explain more fully what went wrong and to offer a personal apology.
“In addition, we will review what happened in this case to establish what measures can be put in place to prevent any reoccurrences in future”
The crimes were alleged to have taken place between October 2012 and February 2013 in East Wemyss, Kitty’s nightclub in Kirkcaldy and Shorehead in Leven.