I think that the case made was arguable, but this was always the likely outcome (assuming that the Supreme Court accepted the case in the first place, which they did). It's extremely clear that the Scottish Parliament can't legislate for independence. It's also clear that they can, in general, legislate to hold referenda. The question is whether a non-binding referendum (that is, one which is advisory and non-self-executing, though obviously with political importance) on independence is in breach of the "don't legislate on independence" reservation. You could make a case that the referendum couldn't change the actual constitutional arrangements (and the Lord Advocate did) but the argument that it's part of a process of change on forbidden matters seems a stronger one to me - as the court found.