Last summer, Mr. Ban reversed course on his list of armies and guerrilla groups that violated child rights in war. In that instance, his special representative for children and armed conflict, Leila Zerrougui, recommended that the Israel Defense Forces and Hamas be included on the list for their role in bombing schools and hospitals and otherwise breaking international law during the 50-day war in the Gaza Strip in 2014.

Israel was consulted before the release of the report, Mr. Ban’s aides said at the time, and both Israeli and American diplomats lobbied intensely against the listing. In the end, both Israel and Hamas were kept off the list. Mr. Ban declined to address reporters’ questions on the matter at the time, leaving it to his envoy, Ms. Zerrougui, to explain the redaction.

The generally risk-averse Mr. Ban has tried to step out a bit more during his last year, but he has also repeatedly had to step back.

In March, on a rare visit to a camp that houses refugees from Western Sahara, Mr. Ban used the term “occupation” to refer to Morocco’s 1975 annexation of territory that the Sahrawis claim as theirs. The Moroccan government responded by ejecting dozens of United Nations staff members, effectively kneecapping the peacekeeping mission there.

Morocco has a powerful ally in France, a veto-wielding member of the Security Council, which helps explain why the Security Council said nothing to persuade Morocco to reverse its decision. That left Mr. Ban on his own, and within days, his spokesman was compelled to swallow his words.

“We regret the misunderstandings and consequences that this personal expression of solicitude provoked,” said the spokesman, Stéphane Dujarric.

Perhaps Mr. Ban’s most awkward moment came when he sought to act independently of the United States. In January 2014, he invited Iran to United Nations-brokered political negotiations over Syria, only to be advised by American officials to rescind the invitation, according to interviews with diplomats at the time.