Here’s what could have happened. The Scottish Government could have made an announcement months ago. It could have attracted praise for its progressive values. It could have saved a lot of hassle and bother and expense. Instead, it spent money and time on defending a bad decision. It prevaricated and obscured. And now, several months on, it has done a U-turn on the quiet. I genuinely do not understand why the Government has behaved in the way it has.

The roots of the controversy go back a long way, to the 1980s at least. You will probably remember the case. At the time, half a million male dairy calves were being exported from the UK every year, mostly for veal. But the industry eventually realised – thanks to a vigorous campaign against the practice – that their image was suffering, and the number of exports dropped dramatically.

However, the trade did not end entirely, I’m sad to say, and latterly Scotland was the last place in Britain where it was still happening. For a long time, the calves were taken abroad from Scotland on ferries via Ireland, but when P&O decided in 2018 it no longer wanted to be a part of it, the industry switched tactics. Instead of going by boat from Cairnryan, the calves were driven to Ramsgate where a ship took them to France and then by road to Spain.

The problem was the conditions the animals had to endure. The calves were usually taken from their mothers on the day they were born and loaded on to the trucks at two to five weeks old. From then on, they were effectively on their own, although the law did say they could not be transported for more than eight hours unless, after nine hours, they were given water and if necessary fed. Compassion in World Farming’s case was that there was no way the journeys could comply with those regulations and they argued that, in allowing the exports, the Scottish Government was breaking the law.

Until a few days ago, the argument was due to come to a head in the Court of Session. CIWF had launched judicial review proceedings and one of their witnesses was Professor Donald Broom, the UK’s foremost authority on animal welfare, who said it was necessary to give milk or milk replacement to calves that are transported for eight or nine hours. CIWF said it wasn’t possible to do that on the journeys from Scotland to Spain via Ramsgate and, looking at the details of the journeys, it’s hard to see how they could be wrong: in practice, calves were going for 23 hours without food and sometimes without water.

At this point, the Scottish Government could have put its hands up and earned credit for prioritising animal welfare, but for some reason it didn’t. Instead, it appointed a QC to fight the case. CIWF also said the Government tried to argue that the problem arose in England (no surprise there then). And when I tried to speak to the Government myself, they told me it would be inappropriate to discuss the case. In other words, they got defensive and secretive when they could have been open and honest.

And now, on the quiet, they have done a U-turn. Until recently, the Scottish Government appeared ready to defend the case, but behind the scenes it has instructed the Animal and Plant Health Agency, which is responsible for approving the journeys, not to allow applications that cannot abide by the regulations, which the journeys via Ramsgate cannot. What this means in practice – at long last – is no more exports from Scotland

The great pity is that the Government has had to be dragged to this point. It is an even greater pity they’re still trying to spin the story. A government spokesman told me they issued their instruction to the Animal and Plant Health Agency after a regular audit of journey times and that the court had “dismissed” CIWF’s case.

Nice try. The Court of Session dismissed the petition not because it found against the arguments but because Compassion in World Farming told the court they didn’t want to pursue the case as the Scottish Government had ended calf exports from Scotland. In other words, the case wasn’t “dismissed”, the Scottish Government did a U-turn and the case was no longer necessary. Why won’t governments just say what has actually happened?

The Scottish Government also wasted a lot of time on the case for no good reason and it’s hard to disagree with the assessment of Peter Stevenson, CIWF’s chief policy advisor. The Government neglected to disclose key information, he says, and, despite export journeys exceeding the maximum permitted time since at least April 2019, they failed to act until over a year later. In short, says Mr Stevenson, the Scottish Government’s conduct has fallen well below what we expect from a responsible authority.

The question is what happens next, because it’s not over yet. The Scottish Government says it is committed to consulting on the recommendations of the Farm Animal Welfare Committee, which says there should be a nine-hour limit on journeys for calves. It would be an important step forward but my advice is to be wary because we know what can happen with consultations: they can often dwindle into nothing. It can be a way for governments to give the impression they are doing something while doing nothing really.

What’s needed is legislation. The Scottish Government has conceded that the export of unweaned calves from Scotland to Europe was breaking the law on the protection of animals during transport. Good. The Government has also done a U-turn to ensure the exports no longer happen. Also good. But it’s not enough. We need strong legislation to protect calves based on a strong commitment to animal welfare.

Will we get it? I’m not sure because it would require an honest statement about what’s been happening in the last few years. The welfare of young, vulnerable animals has been flouted. Calves have been made to suffer on trucks trundling out of Scotland to Spain.

Perhaps the Scottish Government could apologise. Perhaps it could say it was wrong. Perhaps it could say it is now committed to improving the situation. It would be a welcome change from the secrecy and U-turns. For the sake of the animals packed into trucks, I hope it happens.

Our columns are a platform for writers to express their opinions. They do not necessarily represent the views of The Herald.