Several famous courts are or were historically attached to prisons in the UK, eg Lancaster Assizes which were connected to a prison inside Lancaster Castle and were frequently used for high security trials. The Old Bailey (the Central Criminal Court) is built in the former Newgate Prison.
I don't think this is anything to be concerned about - and I believe building courts attached to prisons where people are held pending arraignment or trial is common practice in many countries for the same practical reasons, including some which are arguably in the interests of the defendants (it facilitates a speedy trial for example and can offer them and their defence team better physical security where they might be widely hated eg terrorist suspects or high profile murder trials).
I don't think this is anything to be concerned about - and I believe building courts attached to prisons where people are held pending arraignment or trial is common practice in many countries for the same practical reasons, including some which are arguably in the interests of the defendants (it facilitates a speedy trial for example and can offer them and their defence team better physical security where they might be widely hated eg terrorist suspects or high profile murder trials).