David Cameron is better at tactics than strategy. One of his greatest skills is extricating himself at the last minute from scrapes he might have avoided had he paid more attention earlier.

Nowhere is this pattern more evident than in his handling of Britain’s relationship with the European Union. Mr Cameron has consistently subordinated national interest to the parochial requirements of internal Conservative party management. It is an achievement to have averted all-out civil war within the party for so long but the price has been a policy that is proving unworkable in practice: a renegotiation of British membership terms that can be completed quickly but is also substantial enough to persuade Tory sceptics to support a campaign to remain in the EU.

The past week has exposed the contradiction. On Monday, Mr Cameron received a reply from Donald Tusk, European council president, to his earlier missive outlining British expectations for reformed membership. Mr Tusk warned the process would be difficult, with special emphasis on the lack of consensus around proposals to limit migrant workers’ access to benefits. On Wednesday and Thursday, Mr Cameron encountered that obstacle at close quarters on a trip to Romania and Poland. The usual protocols could not conceal the unhelpful message from Bucharest and Warsaw: Britain is asking too much. Beata Szydło, the Polish prime minister, told reporters she and Mr Cameron did not “see eye-to-eye”.

The practical impediment is that Mr Cameron’s plan would amount to discrimination between citizens from different EU member states within the same labour pool, which is not allowed under existing treaties. And there is no appetite for a full treaty renegotiation elsewhere on the continent. It would open a bidding war of competing national demands and then trigger a round of referendums in countries where popular ratification of European treaties is a constitutional obligation.

Mr Cameron has been told often enough that major treaty change is not an option. But he knows that without it his renegotiation will be ridiculed by hardline Eurosceptics as a patina on the status quo. He has already retreated once from a more substantial reconfiguration of the EU’s free labour movement arrangements when German chancellor Angela Merkel signalled her implacable objection. Yet Downing Street felt it needed something – anything – that could feasibly look like a response to public concerns about immigration. A denial of benefit entitlement appeared to fit the bill and was duly included in the Conservative election manifesto.

Mr Cameron may well have seen this as a disposable pledge, anticipating a renewal of coalition with the Liberal Democrats in which each party’s manifesto would be watered down. Now he is having to water it down without the pretext of placating Nick Clegg – a device that often came in handy during the last parliament.

Mr Cameron has believed all along that undecided British voters, and a large proportion of Tory MPs, can be persuaded to support EU membership so long as the terms are different from those presently in operation – that the detail is secondary because, once the negotiations were out of the way, the broader and more compelling case based on trade, employment and investment can take centre stage. This may be true but the gamble looks riskier if it appears he has been fobbed off with trifling concessions by his continental peers. A modest deal can be sold to voters, but the task is harder if Mr Cameron’s authority is compromised by the modesty.

It is often said that the prime minister performs best under exam conditions – his quick intellect enables him to cram at the last minute and pull off unexpected victories. But international diplomacy does not work that way. It is a matter of constant application, with success reliant more on coursework than final tests. It is not too late for Mr Cameron to win allies in Europe but to do so he must signal clearly that he is interested in the success of the EU project as a whole, not just in extracting what he can to appease a domestic audience.

If the referendum is to be won for the remain camp, the prime minister will have to win an argument about Britain’s long-term interests being best served by partnership with continental neighbours. Increasingly, his credibility in making that case depends on his ability to show not just British voters but other European leaders that he really means it.