What happens if you just leave with no notice? They sue you?
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...