Changing the antenna length changes the frequency efficiency. So that doesn’t work.
Instead, what you want to do is get a probe that can be attached by wire to the Z wave device outside the box. That’s what people frequently do for freezers and for ponds. Works fine.
(The topic title is a clickable link.)
Thanks to @paul_haskins below for the correction. I’ve updated this post. It’s not the frequency itself that changes, it’s the efficiency of sending and receiving messages. But that can really mess up your network. so the same point to be made, just for a somewhat different reason.