Campaigners against the Scottish Government's controversial named person scheme could bring a second legal challenge to the legislation.

The No To Named Persons (NO2NP) group claims the revised legislation put forward by Holyrood ministers is still "vulnerable" to further court proceedings.

Now lawyers for the Christian Institute - one of the bodies involved in the successful Supreme Court challenge to the original law last year - say if the new version is passed they will consider a fresh legal challenge unless Scottish ministers refer the case to the UK's highest court.

Simon Calvert, deputy director of the Christian Institute and spokesman for NO2NP, said: "The Scottish Government has failed to learn from its mistakes.

"The new Named Person Bill neglects to address all of the UK Supreme Court's concerns. If MSPs pass the Bill it will be vulnerable to another legal challenge."

Lawyers have written to Lord Advocate James Wolffe QC warning him ministers could face a second courtroom battle over the legislation if they do not refer it to the Supreme Court.

The letter, from Balfour and Manson LLP, representing the Christian Institute, says: "In the event the Bill passes substantially in its current form and you decline to make a referral under section 33, our client reserves its position in relation to bringing a further challenge in the courts."

It marks the latest step in a sustained campaign against Scottish Government plans to appoint a named person - a single point of contact, such as a teacher or health visitor - to look out for the welfare of all children up to the age of 18.

The Government suffered a major setback when Supreme Court justices ruled in 2016 that elements of the policy were incompatible with the right to privacy and family life as set out in the European Convention on Human Rights (ECHR).

Education Secretary John Swinney was forced to halt the roll-out of the scheme, which had been due to come in across Scotland at the end of August 2016.

Ministers later introduced the Children and Young People (Information Sharing) (Scotland) Bill in a bid to address the Supreme Court's concerns, with the new legislation requiring them to publish a code of practice for professionals on how information should be shared.

But counsel for the Christian Institute, Aidan O'Neill QC, said: "If the 2017 Bill becomes law in its current form, there are good prospects of another challenge successfully being taken to the courts against the 2014 Act (as amended) for failure to comply with the limits on legislative competence placed on the Scottish Parliament by the Scotland Act 1998."

Mr O'Neill added that the changes fail to make it clear that the named person scheme is voluntary and not compulsory.

He said: "Nothing in the 2017 Bill takes up the requirement set out by the UK Supreme Court ... that the voluntary nature of the named person service be set out in clear, explicit and unequivocal terms so no parent is misled into believing that they might be required or compelled to comply with the suggestions of a named person or that any failure or refusal to comply with or co-operate with the named person might lead to escalation of intervention."

A Scottish Government spokeswoman said: "The Lord Advocate has received a letter from Balfour and Manson. He will consider it and will respond in due course. We are confident that the Children and Young People (Information Sharing) (Scotland) Bill fully addresses the issues raised by the UK Supreme Court."