I am afraid this is how it is in Spain, a new law can act retrospectively. A person can be legal in say the year 2005, the Cobbler or whoever can bring in a new law and Mr I.B. Daft can then find that what what was legal in 2005 is/was illegal.
Also with most town halls bust they are looking for new ways to, rob us sorry I of course meant, to say, raise money.
It is “outrageous ” but that is how it is.