I doubt even Apple is stupid enough to end up with a significant quantity of un-sellable stock just to ‘make a point’. Or that major vendors wound not have an agreement to rtv merchandise they can’t sell after a certain date. Apple will either use them for parts or reflash them if possible to meet different jurisdictions’ regulations and sell them there.
In regards to existing devices continuing to be used being better for the environment, the law allows that (which), it allows lighting cables (or micro-usb) to be continue to be sold so you can keep charging your working device. You won’t however have to buy new cables and chargers for a new device if you already have a usb-c cable (and compatible charger), nor will it have to be bundled with every new device.
The software code issue is out of scope of this law. There are initiatives that do somewhat help with planned obsolescence such as requiring manufacturers to allow app installation from alternative sources. Of course they could go further, such as allowing to boot an alternative OS, or preventing malicious compliance better. But that cannot be criticism of this directive.
If the number of phones is small maybe. Though I doubt they can just throw lithium batteries in a landfill in the EU.
There are manufacturer’s that produce different phones with the same name and different hardware for different regions but I could not find concrete info if there’s actual hardware differences for iphones.