From investigating crbug.com/1001436 I have determine the root cause is that there is no check that generating a new constant in GenerateWebGPUInitializers is successful. If all of the available IDs are exhaused the creation will fail, and cause a null reference.
I need to add a guard to detect this situation and return failure instead of crashing.