-
The UK can pull out of the EU. It would not even need a referendum. There is nothing that the EU could do about it. The UK defers some sovereignty to the EU, but can take it back.
Westminster could remove Scotland's devolved powers. There would be nothing that Scotland could do about it. The UK devolves some sovereignty to Scotland, but can take it back.
Scotland cannot leave the UK without Westminster's say-so.
Nothing in what you said persuades me there is a material difference that invalidates the parallel I draw between Scotland's position in the UK and the UK's position in Europe.