We also have that problem with HSTS and other headers, and it’s not only error pages, http redirects are also affected:
https://www.mail-archive.com/haproxy@formilux.org/msg25061.html
https://www.mail-archive.com/haproxy@formilux.org/msg29294.html
https://www.mail-archive.com/haproxy@formilux.org/msg16156.html
This is something that is still on the todo list.