George Osborne went to bed on Monday night feeling surprisingly happy even though he had suffered the humiliation of being booed at the Olympic Stadium a few hours earlier.

The chancellor had, in the words of one senior Tory, "got his man", after David Cameron agreed to appoint Andrew Mitchell as the government's new chief whip.

Plans were also under way to ease Osborne's task in finding an extra £10bn in welfare cuts by moving Iain Duncan Smith out of the Department for Work and Pensions (DWP). Duncan Smith told Cameron he would think overnight about the offer of a promotion to succeed Kenneth Clarke as justice secretary.

Osborne's plans started to unravel late on Monday night when one of his closest friends, the Times columnist Danny Finkelstein, unveiled the chancellor's strategy to the world. Speaking on Newsnight on BBC2 Finkelstein said it would be right to move Duncan Smith to ensure the smooth delivery of the welfare reforms.

The appearance by Finkelstein hardened the view in the Duncan Smith camp that he should stay in the only cabinet post which interests him. But Duncan Smith had never really given serious consideration to leaving his department. In a Guardian interview shortly after the 2010 election he said: "If somebody tells me I have to do something different then I won't be here any longer."

As Tory MPs muttered that Osborne had suffered a setback, the chancellor showed he remains a formidable force when he struck lucky. Justine Greening, who had initially been promoted to the cabinet as transport secretary on his advice, was demoted to the post of international development secretary to clear the way for a U-turn on Heathrow. Greening, who is MP for Putney, is a fierce opponent of a third runway at Heathrow.

One well-placed Tory said: "The reshuffle has been a mixed bag for George. He was one down on Duncan Smith but now evened the score with the Justine demotion. But he will need to be careful. You do not want to cross Justine. She will store this reshuffle away. In years to come she may well exact her revenge."

The setback over the Duncan Smith appointment was the one serious hiccup in the reshuffle. Downing Street made two big decisions months ago which helped ensure the reshuffle ran otherwise relatively smoothly compared with the PR disasters of the Blair and Brown years.

In the first place Cameron decided that a small team – himself, Osborne, his chief of staff Ed Llewellyn and his deputy Kate Fall – would run the reshuffle. Others, notably the outgoing and incoming chief whips and William Hague, were also consulted.

By restricting the reshuffle to a tight group No 10 avoided a string of leaks which could have disrupted their plans. The only serious leak was a Mail on Sunday story saying that Cameron wanted to replace Kenneth Clarke.

The second decision Cameron took was to discover his room for manoeuvre on the eve of the day pencilled in for the formal reshuffle by seeing those due to be sacked or demoted. He spoke on Monday night to Clarke, Baroness Warsi, Duncan Smith, Caroline Spelman and Cheryl Gillan. "These were difficult conversations," one No 10 source said.

This showed that Duncan Smith was unlikely to create a vacancy at the DWP. The meetings also showed Cameron that he would have his work cut out to keep Warsi on board, though he would finally succeed in prising Clarke out of the Ministry of Justice. But he would have to abandon plans to move Clarke to be leader of the Commons after the former chancellor demanded a roving brief, as minister without portfolio in the Cabinet Office, focusing on the economy and national security.

The decision of Clarke to move out of justice paved the way for Cameron to replace him with a rightwinger, though the job went to Duncan Smith's deputy, Chris Grayling, rather than the former Tory leader.

Clarke's insistence on having a say over the economy prompted Labour critics to claim that the chancellor had been weakened.

One former Labour cabinet minister said: "We have heard much talk about plan A and plan B. This reshuffle represents both plan A – Osborne remains as chancellor – and plan B – Ken Clarke as deputy chancellor.

"Of course Ken Clarke was chancellor when the Tories were last responsible for a fiscal consolidation plan which proceeded more slowly and was a success. Clarke will eclipse Osborne."

Downing Street sources dismissed the idea that Clarke's appointment was anything other than a boost to the government. "Ken is vastly experienced. His contributions in cabinet are, and will be, immensely valued by everyone."

As the tight Downing Street circle congratulated themselves, they knew they had one near miss. Warsi woke up on Tuesday morning convinced that she would reject Cameron's offer of a job at the Foreign Office, with a seat in the cabinet, after demoting her from her post as Conservative party chairman. This had carried full membership of the cabinet.

"You shouldn't really do something if you don't believe," crestfallen friends of Warsi said. But she accepted the new post, which is described as a "senior minister of state", after Cameron assured her that she would remain a major force in the government. She will also double up as minister for faith and communities.

The prime minister knew he had to work hard to retain Warsi. He made much of her appointment as the first Muslim full member of a cabinet or shadow cabinet when he first appointed her to the frontbench in opposition.

There was some disappointment in No 10 when Nick Herbert decided to resign as policing and justice minister after Cameron declined to offer him a cabinet post. "That is a pity," one source said.

Tory MPs joked that Osborne had experienced a less than brilliant 24 hours after he was booed at the Olympic Stadium. "Now George knows he is really unpopular and it's personal," one Tory said.

But the chancellor achieved one success. Paul Deighton, the man who organised the Olympics and Paralympic Games, is to accept a peerage in the new year to take charge of the chancellor's infrastructure strategy at the Treasury.