As amended by the Scotland Act 2016, section 28(8) of the Scotland Act 1998 states:
But it is recognised that the Parliament of the United Kingdom will not normally legislate with regard to devolved matters without the consent of the Scottish Parliament.
I can't remember who, but someone famous said this statutory recognition of the Sewel Convention serves as a warning against codifying conventions. But how? I quote some textbooks that prove that conventions can be codified and legally enforced, if UK voters and the UK Supreme Court want to in the future. I know Miller I  UKSC 5 didn't do this.
Mark Elliott. Public Law (3 ed 2017). Page 58.
Third, even though conventions are not themselves generally regarded as legally enforceable, there is always the possibility that they may be turned into laws through the enactment of legislation. Taking such a step should be necessary only rarely: if the underlying principle is so important as to warrant legal protection, breaches of the convention in question should be extremely unlikely in the first place. However, in some circumstances, it may be practically desirable— or politically expedient— to place a given convention on a legal footing. A prominent example arises from the constitutional crisis of 1909– 11, in which the House of Lords (which was dominated by Conservative peers) refused to pass a finance Bill that had been endorsed by the House of Commons, thus preventing the Liberal government from implementing key aspects of its programme. So grave was the situation, and so serious were its consequences, that legislation was subsequently enacted that denied the House of Lords any real role in the enactment of financial legislation.54 It might equally be argued that the Sewel Convention, concerning UK legislation on devolved matters, has been given legal effect. Recently enacted legislation provides that while the UK Parliament can legislate on devolved matters, it is ‘recognised’ that it ‘will not normally’ do so ‘without the consent of the Scottish Parliament’.55 However, the better view is that rather than making the convention into a law, this provision merely signals Parliament’s acknowledgement of (what remains) a convention.
The difference between law and convention is one of degree: laws and conventions should be placed upon a spectrum of types of social rules, a spectrum gradated in terms of the formalisation of rules. Laws lie at the most formalised end of this spectrum, but there is no single, definable, point at which rules shift from being conventions into being laws. Alongside this argument, it will be contended that conventions can become laws through judicial intervention, and that conventions can ‘crystallise’ into laws over time by becoming increasingly formalised. [By way of an example, Barber considers the Ministerial Code— the set of rules governing the conduct of ministers issued by the Prime Minister.33]
Bradley, Ewing. Constitutional and Administrative Law (2018 17 ed), pages 28,9
In 2006, a joint committee of both Houses examined the conventions relating to the role of the House of Lords in the process of legislation, its remit being to ‘consider the practicality of codifying the key conventions’ in this highly political area. The committee flatly rejected the idea of codification, declaring that since conventions ‘by their very nature, are unenforceable . . . codifying conventions is a contradiction in terms. It would raise issues of definition, reduce flexibility, and inhibit the capacity to evolve. It might create a need for adjudication . . .’.168 However, despite rejecting ‘codification’, the committee stated that it would be useful for the House of Lords to adopt resolutions that would clarify the approach of the House to Bills that the government had promised in its election manifesto and also the need for the House to deal with government business ‘in a reasonable time’.
In a democratic state that recognises executive accountability to Parliament, constitutional obligations exist that are based neither on legislation nor on decisions of the courts. Legal rules, whether stemming from the judges or from Parliament, may continue in force long after the original reasons for them are forgotten. The relative informality of many constitutional rules makes for greater flexibility as circumstances change.169 This does not mean that so long as the original circumstances continue, there is no rule or no obligation. The abdication of Edward VIII in 1936 and the reasons for it have had a continuing influence on later monarchs and their advisers. So, too, the process by which Conservative MPs caused Mrs Thatcher to resign as Prime Minister has implications for later Prime Ministers, however strong their majority in the Commons.