Yes, his lawyers provided a cert that he had no other classified docs because what was left behind from the 15 boxes he returned were acccording to the guy that could do it, declassified. What precipitated the raid was an insider telling the Archives that there were still classified documents at the residence. This was incorrect according to Trump and his lawyers. There were still documents that were "labeled" classified and should have been relabeled but weren't. But why didn't the Archives reach out to him to ask about these documents? Because the partisan hack in charge, a now retired TDS sufferer, saw this as a great opportiunity to go out with a bang.
As for what the judge said, he relied on what was given to him by the DOJ. The old saying you can indict a ham sandwich applies here. Even less to get a subpeona for a raid that was totally unecessary.