The man suffered severe injuries to his hand at Southampton Crown Court on Monday, Hampshire Constabulary said.
It added it was investigating but no arrests had been made.
A crowdfunding page has been set up to help raise cash for the man who is expected to be "incapacitated for some time", and had raised almost Â£1,500 by Friday.
More on this and other stories from across the South of England.
Neil Harmston - a colleague and friend of the victim - set up the appeal and described his colleague's injuries as "appalling".
He said they were the result of a custody cell door being "kicked shut on his hand".
He added it was a "particularly difficult time" for the alleged victim as his partner is due to give birth to their child.
GEOAmey, which provides prison escort and custody services in England, said it was also investigating.
A custody officer has suffered the partial loss of two fingers after an alleged attack by a defendant in court.