SelectWindow tab=n can not follow a tab=CLOSE of "Main tab" tab=0

This is the error…
Line 7: No tab with id: 1313135759.

Here is some code to replicate it. Start with two tabs and start macro on left tab.

In my code, the close and tab=0 are many lines apart.
If I change the last tab=0 to tab=1 it still creates an error.
I haven’t found a workaround yet

{
  "Name": "test close",
  "CreationDate": "2022-10-6",
  "Commands": [
    {
      "Command": "echo",
      "Target": "1",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "selectWindow",
      "Target": "tab=1",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "2",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "selectWindow",
      "Target": "tab=0",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "3",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "selectWindow",
      "Target": "tab=close",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "selectWindow",
      "Target": "tab=0",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "4",
      "Value": "",
      "Description": ""
    }
  ]
}

I confirmed the issue. Thanks for reporting it.

For tab t=0 the error makes sense as you just closed it, but it also shows for other tab numbers. We will be looking into this.

Thanks again for reporting this issue. We fixed it with V8.1.16. We also updated the Demo-Tabs macro, it now contains a tab close demo, too.

Hi, select window tabs still do not work in large loops. talking like over 15-34x loops that are successful, but then just reaches selectwindow and gives an error. Same exact code, many loops working perfectly, then stops.