[Debug] ensured that a fatal PHP error is actually fatal after being handled by our error handler

This is a follow-up for #9641 where I try to restore the previous code behavior as much as possible.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a