Lauren Darul, 33, made the successful bail bid on Wednesday but prosecutors applied for that to be revoked during a brief Victorian Supreme Court hearing on Friday morning.
Justice Rita Incerti granted the revocation application and only referenced the fact there had been fresh medical material provided to the court.
"Based on that material, I certainly agree the current plan that was proposed ... is not feasible and doesn't provide the protection I anticipated would be in place," she said.
Darul is accused of stabbing worker Wan Lai in the upper body as she walked along a Melbourne footpath at 7.35am on October 2.
He then ran off, leaving Ms Lai crouched over on the side of the footpath before she was taken to hospital suffering bleeding around her lung.
Darul was arrested 90 minutes later after being tracked to his housing provider Unison, where a 10cm kitchen knife allegedly used in the attack was found.
He has been charged with recklessly and intentionally causing injury and committing an offence while on bail.
Darul, who has complex psychological issues and is now transitioning to become a man, was granted bail on Wednesday following multiple attempts in the magistrates court.
Justice Incerti ordered he had to continue compulsory treatment at forensic mental health facility Thomas Embling Hospital until a bed could be found at the Royal Melbourne Hospital's psychiatric in-patient unit.
Once medical staff were satisfied his mental health was being adequately managed, the justice said Darul would be able to make another bail application to be released into the community.
But Justice Incerti on Friday said it was clear the circumstances had changed and Darul's bail should be revoked.
She told the accused stabber that once hospital staff believed he was fit for discharged, he would be returned to prison.
beyondblue 1300 22 4636