This assumption is not correct. The (4-digit) passcode is entangled with the device's unique ID, which is burned into the A6 application processor (on the other side of the logic board). It's theoretically possible to extract the UID from the A6 at the silicon level, but not realistically possible.
I suggest you read the iOS Security Guide: https://www.apple.com/business/docs/iOS_Security_Guide.pdf