Probably no “solution” as you don’t really “own” your Z- so you don’t have the right to repair it (so you actually end up getting a correct state in HA)
You should be able to “work’a’round” it with a simple template in HA that takes the state of your light and renders your unavailable state to off.
I actually do this a lot and it works great if you have full control and ownership (my stuff all runs esphome and my lights return off when they are off).
This configuration allows to use the “superior” (no flickering) dimming the most bulbs/leds offer but at the same time allows cutting power (using it together wall smart switches) without any downsides