Relay with MQTT commands issue

That doesn’t surprise me. You set retain: true. The MQTT broker now stores (retains) the command topic’s message. Whenever the Wemo D1 connects to the broker, it will receive the last message published to the command topic (independently of Home Assistant).

You should purge the message from the command topic and then set retain: false. Here’s an easy way to purge a retained message: