Nuki Smart Lock Homekit automation with Aqara door sensor fail to close

Hi guys,
I have the Nuki Door Lock 3.0 Pro and Aqara door sensor.
I wanted a simple Homekit automation which is so obvious to have, so created the below :
Lock the Nuki once the Aqara door sensor is closed
(The auto unlock minimum delay is 30 seconds which is too long so I want it immediate. )

So out of 50 times it worked 5 times. No consistency.
So I thought maybe it has something to do with the sensor so I`ve created two different automations which lock/unlock the Nuki when detecting the window sensor closed/open (because in the original automation I did the Nuki opens first and only than the sensor triggers :slight_smile: )
So the window automation works 100% all the times tested. no failures.

In that case I thought - let`s add a dummy automation once door sensor is in Open state - Unlock the Nuki although it is already unlocked.
This worked a bit better and stopped working. I think there are issues with timing or delays.

Anyone had this issue and solved it without buying a Nuki door sensor…?