Anything past the current government's remaining term (< 5 years) can easily be dismissed as "unrealistic" by the next government, meanwhile at the moment pure electric alternatives to some types of vehicles, e.g. offroad SUVs, either don't exist, or at best are in the blindly-preorder-for-next-year-fingers-crossed stage.
With legislation like this popping up in many different jurisdictions, it is extremely unlikely that car manufacturers will just sit around in their lobbying chairs and hope for all the bans to be reversed everywhere. Every manufacturer sees the writing on the wall already thanks to such laws.
By all measures, it is better to pass this law now with a 15 year deadline than in 10 years but with a 5 year deadline. Passing it now with a 5 year deadline, or passing it 10 years ago with a 15 year deadline are not on the table. But the latter option will be on the table 10 years from now, since this law has just passed.