Yes, the code (from the code tab if configured by UI) is most important to enable people to help you. And please use code fences (for logs too) so that’s it’s readable.
After reading again I’m pretty sure that the command is working but the state is not received by openhab. The auto-update only does a blind guess in order to avoid having to wait for the state change of the device. That gives you the impression that it’s working.
Did you enable attribute or attribute_and_json in z2m under settings - advanced - mqtt output-type?
And: This thread is a great source of examples: Zigbee2mqtt revisited: No more ugly transformations