No tab with id:

I hope this time i will get my answer.

user is on tab0
user clicks on this page and another tab opens up - it is active tab1
user clicks on this page and another tab opens up - it is active tab2
close all tab
so this is now tab0
user clicks on this page and another tab opens up - it is active tab1
BUT scripts rather going to tab1 , fails with text in red color
“[error]
No tab with id: 638.”

https://forum.a9t9.com/uploads/db8324/original/1X/2f1117189ca9decb2faea25127f1c40bd3d60425.png