[Debug] fix wrong case mismatch exception
bug #11033 [Debug] fix wrong case mismatch exception (nicolas-grekas)

This PR was merged into the 2.5 branch.

Discussion
----------

[Debug] fix wrong case mismatch exception

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11030
| License       | MIT
| Doc PR        | none

Commits
-------

8e9cc35 [Debug] fix wrong case mismatch exception