I don't know anything about this offender's previous offence, but it he was sentenced to a fixed period of imprisonment he would have been released after serving half of it. No psychiatrist (or other 'expert') would have been involved in the decision. If he had been sentenced to a hospital order (ss37/41) he could not have been released except by the decision of a Mental Health Review Tribunal - an independent body chaired by a judge. Flying Snail is simply wrong in his assertion that psychiatrists call the shots in these cases.
Offenders who are suffering from a mental disorder (which includes mental illness, mental impairment and psychopathic disorder) are not automatically 'excused' from the consequences of their actions. It must be shown in court that the offender is legally insane (not being aware of his act, or if he was aware, then not being aware that it was wrong) - the so-called McNaughton test - or that he was suffering from a mental disorder of a nature and degree to make it appropriate for him to be detained in hospital for assessment, or assessment followed by treatment (Mental Health Act 1983, as amended). The court may fix a term for the period of detention, or may make it without limit of time.
Lastly, many prisoners who are not considered to be mentally disordered at the time of conviction subsequently prove to be unwell and cannot be managed in a prison setting. The MHA contains provisions (ss47&48) to transfer such persons to a secure hospital , but NHS provision is sadly inadequate.