Ah - I think I see what is happening. I think you probably have not scoped your custom namespace subscription in MQTT Engine narrowly enough. MQTT Engine sees the publishes occurring from the device, presumably on a topic like this:
deviceId/relay/0
But, you are publishing on a topic like:
deviceId/relay/0/command
I would guess you have a subscription for the custom namespace something like one of these or some other subscription that results in you getting both of these messages back and MQTT Engine:
deviceId/#
deviceId/relay/#
You could fix this by scoping the topic subscription of the custom namespace to exclude the command messages. For example, something like either of these would work.
deviceId/+/+
+/+/+
I don’t know the full set of topics you may want to subscribe to so you may need to adjust this. The real issue here is that MQTT Engine sees the command topic and tries to add the new tag(s) to the tag tree. But, a leaf tag already exists above this path and it fails with this error message. So, by limiting the topic subscription it would prevent MQTT Engine from ever seeing those (and it doesn’t really need to anyway).