That's how it works.
> Primacy of European Union law
> European law has priority over any contravening national law, including the constitution of a member state itself
https://en.wikipedia.org/wiki/Primacy_of_European_Union_law