If you purchase a cable from somewhere else and it doesn't work with your iPhone, Apple will say "no idea, it's not our cable".
If your Apple custom USB-C cable doesn't work with your Android phone, Apple will say "no idea, it's not our device".
Apple only guarantees that an Apple iPhone can transfer data through an Apple (or Apple certified) USB-C cable. Nothing more, nothing less. They don't have to manufacture their cables to be compliant with USB-IF standards as the EU law is only about charging and not about data transfer.
The reason it wouldn't work would be that they put in hardware to prevent it from working.
Of course that's their fault.
I believe the second revision of the law will be to this effect, which Apple will comply in 2030.