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.

Pull request using this fix : https://github.com/ezsystems/ezpublish-kernel/pull/302

# Test
Manual test.