You are assuming that he was in jail or behind bars when he was produced in court. In reality any one arrested by police is handed over to agencies if they have jihadi links. How many times have we heard of SSP/LJ people "escaping" from custody.
Do you think that those things happen because of superpower of these guys?
You'd be shocked to know how many people sympathize with these jahils among our law enforcement and intelligence agencies.
Why do you think the people living next to the GHQ attackers did not see fit to call police despite suspicious behavior of these guys?
Ofcourse he was behind bars if he was produced in the court, he is not like some kid of saint, that he will willing come to court or to police a day before his hearing.
Anyhow, soon media will show weather its thesame persn or different.