The Treaty of Union of 1707 would have been unlikely to be approved by the Scots Parliament of that time without guarantees concerning the Church of Scotland and Scottish law. Arguably there have been many breaches of the treaty since, which may be thought to render it invalid.
Of particular interest now, the existence of a UK Supreme Court is certainly contrary to the spirit and arguably contrary to the letter of the 1707 treaty and acts. The text of the Acts refers to it as a treaty. Article XIX of the treaty contains the words “...that no causes in Scotland be cognizable by the Courts of Chancery... or any other Court in Westminster Hall”.
Possibly the UK Supreme Court should be asked to rule on whether it should exist ?