It was, by any standards, an unexpected and eye-catching political announcement. When Nick Clegg laid out plans at his party’s conference in Glasgow last year to give a free hot meal at lunchtime to all infant schoolchildren, it took both journalists and the party faithful by surprise.

Worryingly, though, it also took dozens of relevant Government officials by surprise – with only three senior civil servants in the Department for Education (which was charged with implementing the policy) having any idea it was coming.

Now, four months on and just eight months before it is due to be implemented by schools across the country, what seemed like a smart and sensible initiative looks distinctly flaky. It is a salutary tale with a familiar theme: good politics leading to ill thought-out policy.

Download the new Independent Premium app Sharing the full story, not just the headlines

The first sign of trouble came in last month’s Comprehensive Spending Review. When the scheme was announced, Mr Clegg said it would cost the Government £635m. But three months later, George Osborne admitted the cost had risen by 20 per cent to £785m. No one, it appeared, had taken into account the cost of upgrading kitchens and extending school dining rooms to cope with the extra demand.

Since then, things have got even more problematic. The DfE has no idea which schools need money to upgrade their facilities. There are more than 16,000 primary schools in England – some big, some small, some with adequate facilities, some with none. But because free school meals need to be in place by September for the start of the academic year, there is not enough time to do an assessment of which schools and areas need money and which do not.

Accordingly, the DfE has decided to allocate the cash to local authorities on the basis of pupil numbers – not need. Thus Durham and Newham Councils, which have already upgraded their school facilities, will both still get £100,000 – while areas which need more help won’t get it.

Then there is the question of what type of meal will be provided.

Initially, the Government made a commitment that the free meal would be a hot one. A statement on the DfE website said: “The Government will fund schools in England to provide every child in reception, year 1 and year 2 with a hot, nutritious meal at lunchtime.”

Now the Department says this is an aspiration rather than a commitment, because they’ve “discovered” that in many small schools the “dining room” doubles up as the gym and assembly hall, a space which is needed for lessons and activities.

Hot meals take longer to prepare and serve. Small children eat slowly and many schools simply cannot fit an extended lunchtime into their school day. As a result, the Department has accepted that a packed lunch that can be eaten in classrooms will now count as a “nutritious meal at lunchtime”.

But there is one further unplanned consequence of the policy which is potentially far more serious – particularly for Mr Clegg.

Headteachers have pointed out that if everyone is entitled to a free meal, and disadvantaged families no longer need to apply, this puts the pupil premium – arguably the flagship Liberal Democrat Coalition policy – at risk.

The pupil premium provides schools with an extra £900 per disadvantaged child in the form of a government grant. But it is calculated based on the number of pupils eligible for free school meals.

Heads say that because of perceived stigmatisation, it is hard enough to get families to admit they need help – let alone if they get nothing for it. “Unless they sort this out any extra money we get for school meals will be a fraction of what we lose from the pupil premium,” said one figure in the education world who has made their concerns known to ministers.

The sad truth is that all these problems could – and should – have been foreseen. There are hundreds of policy officials in Whitehall whose job it is to work through problems, find solutions and devise policy that works.

But in this case, they didn’t even know about it. The policy was put together on the back of an envelope to provide a catchy announcement for the Lib Dems to trumpet at their party conference.

To its credit, the civil service is pushing hard to ensure that policy making is done on the basis of evidence, openly in consultation with those it will affect, and slowly rolled out to fix any problems before they become critical.

They could have done that with free school meals and countless other policies that have been prematurely set in stone by ministers – if they’d been given the chance.

Open policy making doesn’t necessarily create catchy headlines – but it makes for infinitely better Government.

The truth is all these problems could, and should, have been foreseen.