I don't remember Apple ever saying that it was impossible for them to do it, just that they didn't want to.

It was always kind of assumed that they could, by eg signing a malicious OS update without PIN code retry limits, so the FBI could brute force it at their leisure, or something similar.

They said it was impossible for them to build a backdoor into iOS that would only be accessible to legal requests from law enforcement, which is true in the strict sense. So law enforcement bought a vulnerability exploit from a third party.

> they could, by eg signing a malicious OS update

They successfully argued in court that being forced to insert code the government wanted would be equivalent to compelled speech, in violation of the first amendment.

As the Feds often do, they dropped the case instead of allowing it to set a precedent they didn't want.

> They successfully argued in court that being forced to insert code the government wanted would be equivalent to compelled speech

This isn't true, they never "successfully argued in court". There was never any judgement, and no precedent. They resisted a court order briefly before the FBI withdrew the request after finding another way into the device.

There wasn't judgement because the Feds dropped a case that would set a precedent they wanted to avoid.

Since there is longstanding legal precedent that corporations are people and code is speech, forcing a corporation to insert code that the US government demands is a violation of the first amendment.