An index operand in OpAccessChain can be irrelevant. Thus, TransformationReplaceIrrelevantId can replace it with some other value. However, the new value may no longer be a valid index into the pointer if the latter points to array, matrix or vector. This causes assertion failures in spirv-opt that look like this:
error: line 32: Array access is out of bounds, array size is 8, but access index is 9
%937 = OpCompositeExtract %float %951 9 0
Here, OpAccessChain was replaced with OpCompositeExtract in convert-local-access-chains pass.