I know as much about Spain as the average Brit knows about the UK.🙂
Do you know of any breakaway nation that did not break the law of the central government?
After democracy was reinstated a Constitution was drawn up, of which Cataluña was a part. Referendums on independence are illegal. That's as much as I know, really.
What I would say is that Rajoy has to realise, as should have realised previous governments, that he is governing a group of nations, here. Without looking up on Google, I can think of four languages. ie Catalan, Basque, Gallego and, of course, Castellano. I'm sure that there are many more.
This is like Yugoslavia. Tito held it together. When he died it broke up. Madrid is in danger of that happening here.
He is doing very well with the economy. So did Cameron and the British Conservatives but it needs a lot more than that, to govern Spain as a single unit.
It still seems like he was using the police force to prevent an opinion poll which had no mandate on the Spanish government (nor the Catalan one for that matter). He walked right into it.