Are you not aware that the courts routinely order people/suspects/corporations/arrestees to hand over records, that judges give the police warrants to enter a person's residence and search for evidence,...
Yes, I am aware that those are suspects with other evidence that made them suspects put before a judge who issues warrants or orders. In this case Apple is not a suspect so none of that applies.
“In this case Apple is not a suspect so none of that applies.”
Apple has the codes, just as Swiss banks have been ordered to turn over records when the banks are not suspect.