Version 5.1 C51.exe generates code that randomly resets when compiled optimized level 9, favor size, unless all switch statements are replaced with if-then. This is on years-old stable code that recently outgrew its 32K boundary, which is why we had to optimize for size. No other change is made, and the code runs fine.
The ?C?CASE is unchanged since 15+ years and there is no known bug with it. What you are showing is the code of ?C?CASE itself. However the code reads a table that starts after the call of ?C?CASE. So the issue might be that you run on a code banked system or that this table is not correctly stored on the system. Can you verify the table before the call. This may sound a bit odd to you, but you say "This is on years-old stable code that recently outgrew its 32K boundary". My son grows, but software does not change size when it is unchanged. So the question is, what changes did you made and may these changes cause some side effects.
We had a bug that was there all along but was masked by other factors. See my post on "using 0."