And a Swiss court decided that this was illegal and disproportionate [1]. Rule of law does not mean that nothing illegal happens in the country (that's obviously impossible to guarantee). It means illegal acts have consequences.
[1] https://www.bvger.ch/en/newsroom/media-releases/fedpol-must-...