What happens is if you use the stack too much, the exception record will be overwritten.
Real world case where this happens is IoCreateFile, which calls ExFreePool in the exception handler, and that uses a lot of stack. Result is that the subsequent call to _SEH2_GetExceptionCode may return the wrong value (e.g. 0 which can lead to a lot of confusion).
The test case currently crashes:
psehtest.c:2599: unhandled exception C0000005 thrown from 004078BA
With the printf uncommented and the array fill disabled, the output shows the situation (esp > exception record):
psehtest.c:2897: Test failed: test_PSEH3_bug2 failed
pseh2_syntax: 104 tests executed (0 marked as todo, 1 failure), 0 skipped.