Tag Unavailable for a split second

After wasting many days debugging, I finally found the reasons I get wrong info to display: tag unavailable in flow

This is how the flow looks normally

When I run the flow, some of the tags suddenly (and randomly) become unavailable for a split second, precisely when the flow updates them. As a result, I don’t get the updated information from the flow run because I’m printing the contents of those tags.

Does anyone have any idea what might be causing this?

It happens quite often (more than 70% of the time), but not always. I’ve rebooted the system several times, but the problem persists. I have put in delays/await, still not help.

It happens quite often (>70%), but now always. I have rebooted the system several times.

Where’s the tag coming from?

The tags are from my own HomeyScript. Here is an example how they are generated.

I have several flows calling the same script so I write the results on different tags depending on which flow is calling. In this example, each flow supplies different StopNr and RowNumber

        const tagName1 = `${StopNr} Row ${RowNumber} Left`;

        const tagName2 = `${StopNr} Row ${RowNumber} Right`;


        await tag(tagName1, null);

        await tag(tagName2, null);

        await tag(tagName1, line);

        await tag(tagName2, `${WholeMin} Min`);