John Swinney has apologised for creating "confusion and uncertainty" around proposed changes to the controversial named person policy.

The Deputy First Minister told Holyrood's Education Committee that he accepted he had made a "misjudgement" that had "proved not to be helpful".

The committee has been examining a fresh Bill brought in after a legal challenge to the policy, which will see a single point of contact, such as a teacher or health visitor, appointed to look out for the welfare of every child.

The Children and Young People (Information Sharing) (Scotland) Bill aims to address the Supreme Court's finding last year that information sharing provisions in the original legislation were incompatible with the right to privacy and family life as set out in the European Convention on Human Rights (ECHR).

READ MORE: Ministers ditch legal duty for headteachers to close school attainment gap

The new legislation requires Scottish Ministers to publish a code of practice for professionals on how information should be shared.

Mr Swinney, who is also Education Secretary, told the committee that his decision to provide them with a draft and illustrative code without the necessary consultation had backfired.

He said: "I thought it would be helpful to the committee to have the look of what a code of practice might be like. I accept that that has created some confusion and uncertainty amongst stakeholders."

Tory MSP Oliver Mundell asked how confident the government was about the legislation withstanding another legal challenge, and whether Mr Swinney would "be willing to take personal responsibility and consider your own position if this legislation falls apart?"

Mr Swinney said he approached his ministerial responsibilities "in a deadly serious fashion".

READ MORE: Ministers ditch legal duty for headteachers to close school attainment gap

He said: "I've come to the committee this morning and I've been quite candid about a misjudgement that I have made about giving the committee a code of practice that was draft and it was illustrative and it had all the caveats in the book but it has created more confusion and I didn't want to do that and I'm sorry that that's the case, that the committee has had quite a bit of its time taken up by the debate around a code of practice which actually isn't the subject and the question that the committee is being asked.

"But in coming to the committee with the Bill, I've taken all the necessary advice that I need to take to satisfy me in my judgement that the two issues of proportionality and codification have been addressed in the Bill, but as I say if there's a legal challenge the courts will determine that."

Setting out further steps to offer more "certainty and clarity", Mr Swinney said an expert panel with an independent chair would be established to ensure the code is "workable, comprehensive and user-friendly".

READ MORE: Ministers ditch legal duty for headteachers to close school attainment gap

The government will also lead a positive awareness-raising campaign about the named person scheme and will commit further financial resources "to assist implementation beyond the first year of introduction", he said.

Mr Swinney also confirmed he would amend the Bill to give MSPs final approval of the code of practice.