British court officials have issued an apology to a Black lawyer who says she was mistaken for a defendant on two separate occasions within one day.

Alexandra Wilson, 25, said her identity was brought into question by Her Majesty's Courts and Tribunals Service (HMCTS) after the lawyer told officials on multiple occasions she was there as a barrister for a client, BBC News reports.

On Wednesday, Wilson attended court without her traditional wig and gown, which is customary for the magistrates' court. Upon entering the court building, a security officer asked for her name and then searched for it among a list of defendants.

"I explained I was a barrister. He apologized and guided me through security," Wilson said.

Shortly after, a separate court official told her to go outside and wait to sign-in.

"I explained again I was a barrister and she looked awfully embarrassed and said 'I see,’” Wilson said. "At this point as I was already pretty annoyed, but I went over to the prosecutor and then the clerk told me very loudly to get out of the court room because I had to wait for my case to come on.”

Fighting back tears, she responded that she was a defense attorney and the clerk simply nodded while going back to her computer without acknowledging Wilson.  She added that a member of the public thought she was a journalist and told her "only lawyers can go in" the courtroom.

"All of that in one day, it made me feel exhausted," she said.

Wilson told BBC News she has quite often been mistaken for a defendant but never that frequently in one day. She has said that her situation should be viewed as a reminder that all people deserve respect in the criminal justice system.

"Everyone should be treated with respect," she said. "The fact I was shouted at to get out of court isn't OK for defendants either."

HMCTS chief Kevin Sadler apologized on behalf of the court and informed Wilson that an investigation has been initiated looking into the matter.

“Hello Ms. Wilson, I‘m very sorry about your experience at court yesterday – it is totally unacceptable behaviour and I’m investigating the role of my staff and contractors as a matter of urgency. This is not the behaviour anyone should expect,” he tweeted.

On Thursday, Amanda Pinto QC, chair of the Bar Council, released a statement critical of the court for its ‘appalling’ treatment of Wilson.

"No one should be treated that way whether in their workplace, including when turning up at court to represent their client, or anywhere else. With regret, I fear Alexandra's experience is not a one off. Many barristers have to put up with the prejudiced assumptions of others, Alexandra has done so with exemplary grace and patience,” Pinto QC said.

On Sep. 17, Wilson released a memoir detailing her early career as a mixed lawyer navigating the criminal justice system from Essex, a small city outside of London.

Reviewers of the book "In Black And White" say it is “an insightful look on British Criminal System,” and underscores why the system needs more people involved like Alexandra Wilson.

A fan of the book said she was motivated to continue pursuing her career in business through Wilson’s story of struggle and perseverance.

“Alexandra discusses so many aspects of the justice system in the UK,” Alexandra Mack wrote. “Even though the legal system in the UK has many differences from the system in the U.S., many of the same problems plague both. The problem of not enough barristers/lawyers of color/of different genders exists in both countries."