If the user secret key like a pin is going through iOS, to the secure enclave, you can still run a hacked iOS which reports the stolen pin back to some server.
Typically the os would only have access to the encrypted pin, then use special secure enclave instructions to compute inside the enclave (basically special encrypted memory inside the processor). Ie the plaintext pin would never leave the enclave, even when the os kernel is compromised
If you had the chip in a lab you could do sidechannel physical attacks with lasers and liquid nitrogen, etc