Key missteps mean history may not be kind to the outgoing US president