I don't think that your suggestion would work, because maybe the message was sent whilst node-RED was connected, and therefore your client will have confirmed receipt of it, so why would it want to send it again?
You could always ask your shelly's for their current status, which may also be a more resilient option.
Try the attached flow, leaving the mqtt topics as they are, just update to your mqtt server.
If the inject node is changed to inject once on startup, then it should ask all connected shelly devices to report their statuses, and use that to update the colour of your ui_led's.
[{"id":"8b0af7dd77f5a07c","type":"inject","z":"f8cf7ea5344d6287","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"announce","payloadType":"str","x":120,"y":1350,"wires":[["3099f08e68b6c323"]]},{"id":"3099f08e68b6c323","type":"mqtt out","z":"f8cf7ea5344d6287","name":"","topic":"shellies/command","qos":"0","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"aa11e6d8.6cd088","x":300,"y":1350,"wires":[]},{"id":"9024984f2d995620","type":"mqtt in","z":"f8cf7ea5344d6287","name":"","topic":"shellies/+/info","qos":"0","datatype":"auto","broker":"aa11e6d8.6cd088","nl":false,"rap":true,"rh":0,"inputs":0,"x":105,"y":1300,"wires":[["e7898a73420c34c6"]]},{"id":"d99dacb4bba6148f","type":"debug","z":"f8cf7ea5344d6287","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":410,"y":1300,"wires":[]},{"id":"e7898a73420c34c6","type":"json","z":"f8cf7ea5344d6287","name":"","property":"payload","action":"","pretty":false,"x":260,"y":1300,"wires":[["d99dacb4bba6148f"]]},{"id":"aa11e6d8.6cd088","type":"mqtt-broker","name":"Local server","broker":"192.168.0.8","port":"1883","clientid":"Local node-RED","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"admin","birthQos":"0","birthRetain":"false","birthPayload":"Hello from Local node-RED","birthMsg":{},"closeTopic":"admin","closeQos":"0","closeRetain":"false","closePayload":"Local node-RED is about to exit","closeMsg":{},"willTopic":"admin","willQos":"0","willRetain":"false","willPayload":"Local node-RED has now exited","willMsg":{},"sessionExpiry":""}]