The court's won't have released him unless you mean a court specifically ordered his release.
The probation service IIRC will have been in charge of assessing his suitability for release in conjunction with the prison service (both of which are badly understaffed), with the assistance of any medical/psychiatric reports. If he was no longer able to be held due to the maximum prison sentence running out from memory he should have been held in a psychiatric institution if he was still considered a high risk due to mental health issues.
The Court sets the sentence, comprising of the recommended, the minimum and the maximum in accordance to the guidance and rules laid down by the government (and a judge has to have extremely good reasons to vary from that in any way), with the convict potentially serving the maximum time the judge has said if there is no remorse or they are still considered a threat at when it hits the minimum or recommended sentencing period.
So if he was released part way through his sentence it wasn't the court that released him.
I somehow feel I've post this little bit of basic information about how sentencing works hundreds of times.
Or to put it another when you go to moan about a court being lenient, remember the courts enforce the law, which includes sentencing as laid down by the government they can't just decide to go against what the government has stated unless the government's own instructions go against other established laws and precedents.