fix: panic during the processing of generalized patterns in `grind`

This PR fixes a panic that occurred during the processing of
generalized E-matching patterns in `grind`.

Closes #10983
2 files changed