Sorry if I'm off base. I tried to follow the thread. Do you mean you're triggering with a virtual switch that triggers a cloud integration? It might not be the same but it sounds similar to the challenge I had with my August Lock (non Z-Wave). I'm controlling it with Google Assistant Relay and a RM rule that is changed from true to false states by a virtual switch.
Just like you're describing, whenever anyone opened or closed the lock manually it was not in sync. I solved this by adding a virtual lock. I created another rule where a virtual switch changes the virtual lock state. So when someone unlocks the August lock manually, IFTTT flips the virtual switch on HE and the changes the virtual lock state. Same for locking the August lock manually. IFTTT tracks that it has been locked, the switch turns off and the rule is false, so the virtual lock changes to locked.