It’s probably caused by data in one or some of your notes – e.g. you specified #+ROAM_ALIASES or #+ROAM_REFS with no value.
If I were you, I would try 3 things, probably in this order (because it’s easier to try 1 than 3).
The objective is to find an/some offending note(s).
Turn on toggle-debug-on-error and run the same thing. It might give you the file name that causes this issue
Use grep or ripgrep (or whatever file search program you can use) to look for ROAM_ALIASES, ROAM_REFS, etc. to see if there is any one that has no value
Move half of the notes somewhere else, and run the same thing. Repeat this to narrow down the number of notes, and try to find which file(s) cause the error
If you have headings with IDs, you might need to do this per node, rather than the file.