In chapter 954, we see that Law has somehow escaped from his cell and has incapacitated Hawkins. After questioning him for a short while, Law leaves the prison cell but as he does so, you can see a shadowy figure behind Law. Law says “If letting me walk is part of your plot, then consider me a willing participant.”
I’m more and more convinced that Denjiro/Kyoshiro is the one who freed Trafalgar Law.
I know people think it’s X-Drake, but X Drake’s mission in Wano – whatever it is for the Marines – far exceeds the Straw Hat Alliance. Him helping Law in front of Hawkins seems unlikely and too obvious. He joined Kaido for a very specific reason, long ago. I don’t think he’d jeopardise it for the Straw Hat Alliance.
Orochi has some sort of informant that he trusts. Someone on the inside. Maybe he has Intel from Kyoshiro who is getting leaks from Shinobu if she knows his identity? Maybe Hiyori had enough info to fill Kyoshiro in and produce the report to Orochi as part of his plan?
Maybe the person that set Law free was not X Drake, but it was Kyoshiro. Law and Kyoshiro came up with the ‘let Orochi think he has won’ plan. Kyoshiro could have told Law certain info without telling him he is a Scabbard.
*Theory by BFBooger