What I mean to say is that this assertion that you are adding in this PR catches the error you intend to catch, but it is also catching other cases that are not valid to assert.

While I cannot share internal code, it stands to reason that if the internal code were invalid, it would crash with the same bad error message you are trying to fix here. I am going to close this PR as the internal test proves that it asserts when it should not. Unfortunately, I do not have a simple reproduction of this case.

I appreciate your work on this, it just does not work in the way that you expect.