At component level, yeah no impossible but for general resale it wouldn't be too hard. I'm pretty sure the Face ID and Touch ID modules already do this.
You would need to add some general identifiers to parts with a GUID and at production/official repair time, register those parts to an iPhone S/N. If Activation locked, those parts would need to not be able to be registered to another iphone until the original device is unlocked, thus clearing those parts.
You would need to add some general identifiers to parts with a GUID and at production/official repair time, register those parts to an iPhone S/N. If Activation locked, those parts would need to not be able to be registered to another iphone until the original device is unlocked, thus clearing those parts.