Local authorities are in danger of repeating past mistakes by failing to make sure that opencast coal companies put aside enough money to clean up the mess they make, a leading industry expert is warning.

The Sunday Herald can reveal that councils were alerted seven years ago that they would face a major crisis in funding the restoration of old mine sites if coal firms went bust.

But the warning - which has proved to be eerily accurate - fell mostly on deaf ears.

Councils were consulted on a damning but unpublished study in 2006 which exposed multiple flaws in the system of insurance bonds meant to cover the costs of restoring ruined landscapes.

The study was conducted by Rod Smith, a coal industry specialist who has managed and advised on opencast sites in Scotland for 37 years.

He is concerned that the scheme for restoring the new opencast mine which is planned for Cauldhall Moor, south of Edinburgh, may be deficient and could unravel. The mine, near Penicuik, was given the go-ahead by Midlothian Council last month.

Smith's study, which has been passed to the Sunday Herald, will provide vital evidence to an ­investigation being undertaken by Audit Scotland.

MSPs and environment and community groups are also demanding an investigation into the matter by the Scottish Parliament.

Last week the Court of Session ruled that the liquidators for the defunct Scottish Coal company could not abandon their responsibility for old mine sites.

But campaigners warned that this is unlikely to actually help restore the sites because of funding shortages and legal get-outs.

The Sunday Herald disclosed last week that local authorities are facing a £200 million shortfall in the funds they need to restore the landscapes scarred by 32 opencast mines across central Scotland.

The cash set aside by two big coal companies before they collapsed this year only amounts to a quarter of the sum needed.

Precisely this crisis was predicted in Smith's 2006 study, which said that if coal companies went bust it would be on a scale unprecedented in the Scottish coalfield.

It would be potentially disastrous for East Ayrshire, South Lanarkshire and Dumfries and Galloway, he cautioned, and could create large-scale dereliction.

There was a "catalogue of ­inadequate or irrecoverable bonds throughout the Scottish coalfield", the study said. Councils had left it to coal companies to estimate the cost of restoration - a process that was clearly open to manipulation, Smith argued.

Councils failed to spot the flawed working methods proposed by companies, he said.

"Planning officers dealing with the applications were presented with fine words and pretty pictures, but had no-one to turn to for advice on whether it all made sense or not," he said.

Councils also failed to ensure companies did what they promised they were going to do, and that the insurance bonds were sufficient, it was claimed.

"It was open season for the operators, who could disregard commitments in the knowledge that no-one would take them to task," Smith said.

Open cast mining continues in Scotland and there are plans to extract 10 million tonnes of coal from Cauldhall Moor.

Smith claimed that the restoration scheme relied upon the entire site being worked.

"If it was to be abandoned half-way through, then the scheme would unravel," he said.

"It would be irresponsible of the council not to commission a review before proceeding further."

However, Smith defended Hargreaves, the Durham-based company that has taken over Scottish Coal's plans for Cauldhall and mines elsewhere.

It was "the only available option for restoring some of the abandoned sites to a half-decent standard", he said, and was contributing to Scotland's only successful restoration, at St Ninians in Fife.

East Ayrshire Council, the local authority which has by far the most abandoned opencast mining sites, is considering Smith's study as part of an independent review due to be published next month.

Fiona Lees, the council's chief executive, said that with Smith's help, the council has already improved its monitoring.

Midlothian Council insisted that phased work at Cauldhall would ensure restoration took place.

A council spokesman tolf the Sunday Herald: "We're finalising strict legal conditions that ensure we've learned from the experiences of others."

However, this was dismissed as dangerous nonsense by Malcolm Spaven, who is chairman of the Scottish Opencast Communities Alliance.

According to the Royal Society for the Protection of Birds, Scotland had suffered "a systemic lack of willingness to properly regulate the industry".

ONE opencast coal mine in Scotland is being successfully restored, and the resulting "land art sculptures" by the renowned landscape artist Charles Jencks are due to open to the public in 2015.

St Ninians in Fife looks like being the only site that will escape the funding crisis blighting dozens of other old mines across central Scotland.

This is because Fife Council ensured that the insurance bond agreed by Scottish Coal was continuously reviewed so that it would cover the cost.

According to Rod Smith, employed by the council as the site's independent "compliance assessor", the value of the bond peaked at £10 million in 2009.

The site's operator, Hargreaves, is also helping to pay for the restoration.

"The site will be restored largely in line with the approved design," said Smith. "It will be unique in Scotland, and demonstrates what can be achieved through effective regulation."