The woman was giving evidence at the High Court in Edinburgh
An alleged rape victim, who was locked up for trying to flee court when she was giving evidence, has made a complaint against the judge.
Temporary judge Roger Craik had the 43-year-old woman, who cannot be named, arrested and held in cells overnight.
The rape charge, which related to an alleged incident in the 1970s when the woman was 12, was eventually dropped.
The Crown Office said it had received the woman's complaint and would look into the case.
Judicial public information officer Elizabeth Cutting said no complaint relating to the matter had been received by the Lord Justice General, the head of the High Court of Justiciary.
The accusations relate to the case against George Cummings, who was convicted last week of sexually abusing two young girls almost 40 years ago.
Mr Cummings, 69, was found guilty after a trial at the High Court in Edinburgh.
He began abusing one of the girls when she was aged just three and went on abusing her for another six years.
Cummings, from Grangemouth, subjected his other young victim to five years of abuse which began when she was six.
A charge alleging he raped a 12-year-old girl was withdrawn.
The woman who made the allegation, who is now 43, struggled to cope in the witness box.
Mr Craik, a sheriff acting as a temporary judge in the case, had her arrested and remanded in custody.
She spent the night in cells at St Leonard's Police Station in Edinburgh.
She was brought back to court the following day to complete her evidence.
The woman has now made a formal complaint to the Crown Office.
A spokeswoman for the Crown Office said: "The decision to remand the witness in custody overnight was taken by the court.
"Through our Victim Information and Advice service, we have endeavoured to be supportive towards this witness at all times, as we would with all vulnerable witnesses.
"Having received her complaint, we will work alongside the Scottish Court Service to look into the case."