Are the fields in question globals?
Your script deletes all records in the report table, but then doesn't create any new one(s) before writing (or trying to write) field contents from the variables.
You are my hero Erolst!
Had never heard about Gobal Storage so checked the manual - and yes that was the problem. Big thanks!