Related Issue: "Why Does My Device Show Offline When My Phone Disconnects from Wi-Fi and Online When Reconnected?" Please also refer to this explanation.
If you can only control your device when connected to your home Wi-Fi but not when using 4G or other Wi-Fi networks, it indicates a problem with your home router's connection to the internet. This issue prevents the device from communicating with the cloud, thereby restricting control to the local network (using your home Wi-Fi).
Please check your router's internet connection and ensure it is stable and functional, then try again.