A SEX attack accused Bulgarian man charged with targeting a schoolgirl in a Port public toilet is back on the streets as a direct consequence of a custody staffing crisis at Greenock Sheriff Court.

Mihail Iliev, 32, had been due to stand trial on separate allegations of performing a disgusting act in front of a female doctor onboard a train and intimidating the woman by staring at her.

But the case was thrown into 'utter chaos' because private security firm GEO Amey didn't have enough personnel on duty to allow it proceed — resulting in Iliev being let out on bail.

Sheriff Daniel Kelly — who had locked him up in May citing a 'substantial risk' — said: "It is of grave concern to me that this trial has not been able to go ahead due to a lack of available custody staff."

GEO Amey's inadequate number of staff at Greenock were engaged in other pressing custody matters which meant that Iliev's case called with just 30 minutes of available court time remaining.

He had been on remand for 36 days out of the maximum of 40 days allowed by law, and the earliest date that the trial can now proceed is July 31.

A court source said: "The summary trials court has been utter chaos, and it's not just this case that has been affected.

"Other matters have had to go off because GEO Amey simply didn't have enough people to cope with all of the business.

"It's simply not good enough when a sheriff has no choice other than to bail a man facing serious sexual offences allegations because of woefully short staffing numbers."

GEO Amey, an Anglo-American company, succeeded previous service provider G4S in January after emerging as the only bidder for the £238 million, eight year Scottish courts contract.

Company bosses yesterday branded the shambles at Greenock 'simply unacceptable'.

It is understood that the doctor whom Iliev is said to have targeted on the train between Paisley and the Port had been waiting in court all day to give her evidence.

Iliev had been freed on bail by a visiting sheriff on a charge of indecently assaulting a 14-year-old girl on May 22 within the toilets on Fore Street.

But he was immediately detained by police and later remanded in custody after details of the alleged train offences, which are said to have occurred earlier on May 22, came to light.

Sheriff Kelly said: "I make no criticism of [GEO Amey] staff resident at this court who have made every effort possible to ensure these courts proceeded as planned.

"However, the Crown is in a position where the only reasonable motion they can make is to adjourn this trial, and I grant that motion."

Prosecutor Lindy Scaife was granted special bail conditions forcing Iliev to check in at Greenock police office every Friday before 5pm and notify the court of any change of his address — currently Highholm Street in the Port — within 24 hours.

Iliev has denied all of the allegations against him through lawyer Edward Sweeney.

Sheriff Kelly told the accused: "With hesitation, I will release you on bail.

"If any of the conditions of bail are breached that will be a separate offence and you would be remanded in custody again."

A GEO Amey spokesman said: "We took over the operation of this contract five months ago and have been progressively changing the delivery model to better reflect the needs of our criminal justice partners across Scotland.

"As part of that process, we have reviewed the working practices we inherited and are recruiting additional staff to enable us to manage demand more effectively than the current delivery model provides.

"The issue at Greenock Sheriff Court is simply unacceptable to us and we apologise unreservedly to the court, and all others affected, for the problems experienced.

"Whilst making the necessary changes to the delivery model inevitably takes time, as does the recruitment and training of new custody officers, we will continue to do all we can to ensure that court business is not disrupted whilst we complete our plans.

"Whilst the majority of individuals are presented to court at the time required and without incident, we remain committed to continual improvement of our performance standards to deliver a dependable, efficient service to support the criminal justice service in Scotland."