This newspaper has supported the principles of the Scottish Government's Named Person scheme.

The SNP and numerous children's charities are correct to complain that characterisations of the policy by other branches of the media as some kind of Orwellian invasion into family life have often strayed into the realms of the hysterical and nonsensical.

Indeed, it has operated successfully in some areas, such as Highland, for several years, with none of the overblown warnings of named persons issuing diktats over TV time or bedroom decorating decisions coming to pass.

As the Supreme Court said, in a ruling on the legal challenge brought by the Christian Institute and others, this well-intentioned policy is "unquestionably legitimate and benign". This is what makes yesterday's verdict all the more frustrating.

The defeat yesterday for the Scottish Government – and despite John Swinney's attempts to claim some form of victory this was a humiliating defeat – could so easily have been avoided.

The issues the judges found were not with the principle of the named person itself, nor its universal nature, which much of the more zealous opposition has been based on. Instead, it seems, it is shortcomings with the guidance and legislation itself that has led to this setback.

The sloppy, ambiguous wording and definitions has given rise to legitimate concerns named persons could go too far in their duties, perhaps through over-enthusiasm, incompetence or simply because they are unclear about what their role actually is.

Make no mistake, the vast majority of teachers and health visitors, assuming workload concerns were managed, would have performed their role sensibly and professionally. But for their benefit as much as anyone else's, it is vital the remit and boundaries are clearly defined.

Instead, they are expected to rely on loosely defined terms such as "wellbeing", when deciding when it is appropriate to step in and how far to go. When assessing wellbeing, professionals are asked to think SHANARRI (that's safe, healthy, achieving, nurtured, active, respected, responsible, and included) but as the Supreme Court noted: "These factors are not themselves defined, and in some cases are notably vague: for example, that the child or young person is 'achieving' and 'included'".

On the crucial issue of sharing information, it was found "the task facing the [named person] is a daunting one because the Act does not address the factors to be considered in an assessment of proportionality and gives exiguous guidance on that issue."

This was the Scottish Government's second attempt at guidance, after a string of professional bodies sympathetic to the scheme warned they were unsure of the scope of their roles well over a year ago. They repeated familiar concerns, that terms such as "relevant and proportionate" were open to wide interpretation, leading to confusion, but even after credible warnings the Government fell short.

There are serious questions to be asked over competence in drafting legislation, while ministers have consistently struggled to explain the policy. Needless errors have dealt blow after blow to the Named Person scheme. The Scottish Government will have to up its game if its introduction is not to become untenable.