EDIT: I misread your code, this actually looks like a bug in your particular case.
However, if you wanted to allow values between -2 and 2 for example, and forbidding zero, it would currently not be possible. What I do in this case usually is to either expose the variable in a different way (multiplier instead of a divider for example) or just add a defensive if in the setter to be sure to not set incorrect values.
If you need only a few values though, maybe you could export it as an enumeration?
In 3.0 there have been mentions of improving range definitions https://github.com/godotengine/godot/pull/11599 but I don't know what's the state of it.