currentValue for contact is open (i.e. not updated), even though latest event says closed

It is an Aqara contact sensor with the driver from here: [Release] Xiaomi / Aqara / Opple Drivers with Presence!

However, I have seen the issue on a Smartthings multisensor (with the default driver) as well.

I have one aqara sensor on my desk where it is easy to recreate the issue by simply waving the magnet in front of the sensor a couple of times. I haven't removed any of the smartthings sensors, so there it is a bit more difficult to recreate the issue as I have to open and close the door in rapid succession.

The failure mode is always the same, the dashboard and event log is correct, while the currentValue() is incorrect, which in turn affects my app and Rules engine.