Index was outside the bounds of the array.

Just started having a weird issue. I have an app which uses a Google Sheet as its data source. In fact I am just rewriting it as a new app with a new google sheet. Anyhow, when I regenerate one particular table I get this “Index was outside the bounds of the array” error but I cannot find any more clues. If I save the app again the error goes but there is some wacky results from select statements.

The table in question has 12 sheet columns and a further 45 virtual columns. Yes I know that is a lot but it is a kind of a “what if” type app where you change the date and see the results for some date in the future.

Anyone with any suggestions on where to start looking? I am too far along with my rewrite to scrap all my work and start again.

Thanks

As a test, I created a new test app just loading this one data table in to it and there is not an error. I guess that proves the error is either in the schema of my original app or something relating to the VCs.