I’m having a little difficulty with your description of the problem. Please advise if this is correct: It seems that you’re trying to capture the contents of a table. The source of that table is a desktop application.
Your code seems to imply you’re trying to retrieve one row at a time. Generally speaking, it is best to capture the entire table at once, then loop through the table.
When you run your automation, it cannot find the table the second time around. In that case, check the DOM XPATH of the table captured the first time and compare it to the DOM XPATH of the table captured the second time.
The DOM XPATH isn’t the only parameter that can cause a table to not be captured. If you have a property that contains the contents of the table (e.g., HMTL InnerText -- yes, I know that won’t show up on a desktop application, but this is an example), that needs to be turned off when trying to capture the table.