As an aid, let me show you a video: https://streamable.com/c2bnko, though it's not needed to follow this question.
I'm going to edebug org-id-alist-to-hash (0:13 in video). First I verify that the variable being passed in is a list (namely org-id-locations). Which is shown true in edebug too...but then on the next edebug step, point is still on the same symbol, and now the echo area shows it as a hash table. Which then crashes the function, of course, since it expects a list.
What could be going on? Why would it satisfy listp, but change its mind and be a hash table before org-id-alist-to-hash can do anything with it?
I cannot make code to reproduce, since it's intermittent or depends on very particular circumstances.
(when (listp org-id-locations) (setq org-id-locations (org-id-alist-to-hash org-id-locations)))which sounds exactly like the "started as a list, now it's a hash" symptom. So... can you explain more clearly what the issue is?