I wouldn't say it will either harm or help his defence specifically, whether he is on a CTO may mean the court would come to a different sentence should he found guilty. There are too many factors for me to make any judgments and I am not instructed in the matter. However this may show diminished responsibility should he be found guilty, it is more about his state at the time, now just now. If their defence solicitor does not agree with the doctor's assessment, they can look at obtaining one from a different doctor as part of the defence proceedings.
I shall provide you with a helpful link that will assist you in finding a solicitor/representative near your local area. This will provide you with someone nearby your area who can assist you if required.
I hope this information proved helpful. You will find a local solicitor who deals with these matters on the law society webpage which is as follows;
https://www.lawsoc-ni.org/solicitors (N. Ireland)
Hopefully, I have answered your query in a way that is simple and easy to understand. If anything remains unclear, I will be more than happy to clarify it for you. In the meantime, thank you once again for using our services.
Should you require any further assistance on this matter, please do not hesitate to post a further questions for additional assistance.