I'll probably end up needing to post the code when I can, but I can at least describe the problem:
The script is indexing item name data to the SavedVars. It's supposed to put it in a table in a table (which it does), but randomly it'll end up putting some of the table vars in there as indexes with empty data. Such as SavedVars, @Rhyono, Defaults, a few of the data pieces as variable names (e.g. instead of [index] = data, it's [data] = "").
I had been saving it to file for easier load on the client, but I may just return to having it assemble it on demand live rather than saving it in a file.
data from savedvars use a lot more memory and create loading incredibly much longer than rebuilding from scratch.
If your data don't need to be altered by user, generate it from API calls at startup, or if your data can't be accessed throught API, just provide big arrays of static data.
per example lorebooks addon with ~15k sub entries of static data only use 3MB in memory.