That doesn't really work in this case though. A majority in the Catalan parliament voted for the independence referendum but it was disallowed by Spanish law. Support for Catalan independence is necessarily going to be of limited interest to voters outside of Catalonia, so changing the law at the Spanish level isn't something Catalan's can really hope to achieve.
Your "Texas vs. Federal Government" argument is weak:
1. The local Catalan parliament is not above any national law. Your argument reminds me of the Texas Government vs any US Govt.
2. The pro-independence seats in parliament in Catalonia is a voter minority... in Catalonia. Check your math.
Most secessions are illegal, the US from Britain, Texas and California from Mexico. I personally don’t see anything wrong with Texas becoming independent from the US should it choose to. (Confederate secession was wrong because it was about perpetuating slavery.)
The referendum law was passed by a majority of members of the Catalan parliament. It just seems very odd that Spain would not work on a mutually acceptable structure for an independence vote. Especially if a majority of people would vote against it!