This is not at all what we are looking for.
Maybe display a big, scary "unofficial OS, you're on your own, don't bother us if your iPhone becomes unusable". Maybe have one jump through some hoops, like getting an "approval" code by signing some mile-long EULA on the iCloud account stating you forego any software-related warranty / support.
This should be enough to deter "regular users" from messing with their phones, and Apple wouldn't have to go to any length to guarantee that a "restored" device isn't compromised. Kind of like the KNOX thing on Samsung phones used to work.
And this actually seems to be possible, since people are having success with running Linux, a non-apple sanctioned OS, on the M1 Macs, which have the secure enclave, etc. My understanding is that whatever issues they are experiencing are related to hardware support.
This is it right here. Power-users will blame the user for having their device compromised. Users, on the other hand, will blame Apple. Apple will do anything they can to avoid negative PR like that.
I don't know what the state of the world is today, but I've installed custom OSes (mostly Linux) on every Mac I've owned (my most recent was a 2012 Retina which I really liked).
Installing a custom OS isn't easy and it's pretty obvious to everyone it means thinking "Yes, it's a good idea to lose support for almost every program I run". By "everyone", I really do mean that: I've never heard of an anecdote of someone who's mother wiped MacOS and threw Ubuntu on their box and encountered some bugs. Technical knowledge about security isn't out there, but we do get "Apple makes the system that is an iPhone, going away from Apple's product means abandoning my iPhone" seems to be there, even if they don't understand what it means for something to be an operating system.
"Security" has become the excuse big companies use for everything they foist on users. Better update to that new OS version that ruins the user interface -- it comes with security patches! Better make sure you can't play any games that aren't approved by Apple -- it's the only way to make iPhones secure! Better centralize the entire Internet so it all depends on four or five giant corporations to run -- they're the only ones who can be trusted to implement security!