This would be the use case, where you would break the law, when entering such restriction zone. Unless, of course, your skin tone has the right shade, as police unfortunately does things like racial profiling. If pale, you were on your way to a cooking party - if darker-skinned, you luckily were caught in the act!
I do not say that all laws are futile. The difference with this particular measurement is that it is odd to me, that a no-weapon zone is being established, as it is quite unusual that Germans carry around weapons in general. At least not where I live. People carrying around weapons of any kind is just not a thing here.
There are other laws, speed restrictions for instance. I get that there is a necessity to enforce such thing, as people have cars and tend to drive faster than they should. Speeding with a car is more common than carrying a weapon. That’s why this law makes sense, as it adresses the issue right there. Speeding doesn’t have an underlying issue that causes drivers to speed.
The thing what makes it futile in my opinion is that a restriction in carrying weapons does not solve the underlying issues (the root causes of socio-economic inequality, among others) that probably lead to harming others with knives. It’s just treating the symptoms, not the root cause.