Network error:-999999) Remote api run failed

Has anyone hit this issue when running an automation?
It is not consistent, some days it works fine, others, more recently, I hit this error.

I have been running this automation for over a year and it was behaving as expected.
Each of the triggers represent different times of day to turn on/off lights around the house. There is also a sensor that keeps count of the number of lights on at any point which I use in a dashboard.

The fact is if the automation fails, I can use a regular integration action to turn off the lights that failed in the automation.

Any thoughts or pointers?

Figure out which of those devices threw that error. You probably have a log entry matching that at the time the call happened. Chase that.

You can set continue on error if you want it to not care if one of the calls errors.

Which one of those devices is a Tuya Wifi device? You have 1 second bug or new limitation? - #15 by peteruk1

The option that fails defines five sequential actions
The first action is to turn on 5 switches that have lights plugged in. That step appears to run ok
The second action appears to be where the issue occurs. That is to turn off a group object which is a collection of 4 Tuya GU10 lights called ‘Garden Lights Patio’. I have noticed that on occasion 1 of the four lights drops off the network then joins again. I wonder if the action to turn off the group when one of the lights is not available will trigger the error.

At the moment I have the lights connected using the standard Tuya integration. However, I am in the process of moving over to use the Tuya Local integration (not the Local Tuya) to see if the issue is resolved if I avoid the bulbs connecting to the Tuya servers.

The issue occurred again tonight. So in order to ensure the rest of the actions take place, I am setting the ‘Continue on error’ flag. However that feels like I am treating the symptom rather than the cause.

There is a thread on GitHub that some might find useful, Tuya: network error:(-9999999) Remote api run unknown failed #179722
This is a little out of my depth, but may help those who can follow the logic of a temp solution offered by chuppito