The proposed law would have compelled the UK to meet new legally binding targets on climate change.