Dashboard bug - Momentary switches

I have a switch device which is set up in a momentary fashion (When turned on, do x, and auto turn off) but when I have this on the dashboard, and press the switch to turn on, most of the time it works fine (sends command 'on', then gets the 'on' update message followed by the 'off' update message), but every so often, it gets in a mess and receives the 'off' but doesn't actually change the tile to 'off', as you can see the final command pressed was an 'off' followed by single 'off' update message, despite having received the prior 'off'.

14/05/2023 19:01:32 - Sending Command on to id 137
14/05/2023 19:01:32 - Handling message: on for device id: 137
14/05/2023 19:01:32 - Handling message: off for device id: 137
14/05/2023 19:01:32 - Command Sent
14/05/2023 19:01:36 - Sending Command on to id 137
14/05/2023 19:01:36 - Handling message: on for device id: 137
14/05/2023 19:01:36 - Handling message: off for device id: 137
14/05/2023 19:01:36 - Command Sent
14/05/2023 19:01:38 - Sending Command on to id 137
14/05/2023 19:01:38 - Handling message: on for device id: 137
14/05/2023 19:01:38 - Handling message: off for device id: 137
14/05/2023 19:01:39 - Command Sent
14/05/2023 19:01:40 - Sending Command on to id 137
14/05/2023 19:01:40 - Handling message: on for device id: 137
14/05/2023 19:01:40 - Handling message: off for device id: 137
14/05/2023 19:01:40 - Command Sent
14/05/2023 19:01:42 - Sending Command on to id 137
14/05/2023 19:01:42 - Handling message: on for device id: 137
14/05/2023 19:01:43 - Handling message: off for device id: 137
14/05/2023 19:01:43 - Command Sent
14/05/2023 19:02:33 - Sending Command off to id 137
14/05/2023 19:02:33 - Handling message: off for device id: 137
14/05/2023 19:02:34 - Command Sent

The device is 'off' prior to the ''off' command at 19:02:33. Refreshing the dashboard using browser refresh or pressing the green tick makes no difference. When I go to the device panel, it shows it as 'off' and not needing to be turned off, only the dashboard shows as 'on'.

I've identified it's probably linked to the sendEvent in the momentary switch driver having no delay, as if I had a 100 millisecond delay between the calls, dashboard doesn't get confused. Not ideal.