I think this is caused by internal state caching, as the state update takes some time to propagate and be read back. This is an issue we constantly face with Mervis, but in practice is true for all asynchronous communication with the device. Is it possible that the physical real state is at odds with what you get back from EVOK?

If that is indeed what is happening, then unfortunately there isn't much we could do, besides using a write-back cache for relays. Which potentially could cause desynchronisation issues further down the line.