Hate to break it to you, but this is exactly how Judiciary operates in each and every country in the world. They are nothing but a tool of the establishment and the deep state of their respective countries. You can find numerous examples of illogical and paradoxical decisions passed by courts all over the world.I am not a lawyer but anyone remotely "sane" already knows that our judiciary is a sad corrupt joke. Criminal and corrupt political mafia dynasties such as the Sharifs should have been behind bars long ago or court martialed for high treason instead they are used as an arm of the corrupt establishment to keep the sad status quo intact.
Powers of the SC and HC CJ to constitute favorable benches, for favorable judgements, this is the root cause of the rot. A new structure/law should be legislated to make it fair and transparent but that would not suit the establishment.
Here in US, the New York Supreme Court ruled that since the Muslim community didn't know they were being spied on by the gov't, hence no spying took place and the lawsuit by Muslim community against the gov't is without merit.