That being said, the role is in Germany, where it is, to a limited degree, possible to sue for damages resulting from not honoring the notice period. It is also common to add an additional limited a priori damage value into the contract. Not legal advice. [1]
Anyhow, for anything below a managerial role I've never seen a company enforce those rules. They're mostly a deterrence, I suppose.
[1] https://www.haufe.de/recht/arbeits-sozialrecht/wenn-ein-arbe...