Fix EZP-20287: Error code in legacy not sent to the symfony stack

# Description
When an HTTP error would happen in the legacy stack. The symfony stack would not send the HTTP error code.

This commit adds error information for the symfony stack to use.

# Test
Manual test.