How is it integrated? MQTT switch? Or via an automatic discovery thing?
If you have a configuration, can you post it here?
What are your tasmota settings?
Does your switch have a good wifi signal? With MQTT, if you’re not using retain (which you shouldn’t be for cmnd topics!!!), if it doesn’t see the change, it won’t do anything.
Can you open the console and look at the log while you send the commands? Does it always notice the command? My guess is only sometimes.
IF (and I mean IF) you don’t have a reliable connection but want to continue using it, you can turn on MQTT retain for this cmnd topic, BUT it must be enabled from ALL devices that might control this. If there is any single device that doesn’t have retain setting enabled, you will have a problem where the switch will turn on/off randomly when it disconnects from wifi as the last state you told it wasn’t retained, so when it reconnects, the MQTT broker sends it the last retained message (the one actually marked retained).
This is why you should almost never use retain for cmnd topics (state topics from Tasmota device…certainly). But, if EVERYTHING that can send a cmnd to that device has retain on, it will work just fine…and can help in cases where the device has a poor connection. In this case, when the device reconnects, it will get that last cmnd sent to it and respond to it, so you might just have a slight delay in some commands.