Theresa May’s final days in office are a lesson in learning from failure