And So I using cakephp and taking advantage of ajax to submit forms. In some instances it returns a custom error.

For instance, at some point it may be like:

Failed to load resource: the server responded with a status of 412 
([{"field":"PaymentCardholderName","message":"Please enter CardHolder's Name."},
{"field":"PaymentCardNumber","message":"Please enter Card Number."},
{"field":"PaymentCvvNumber","message":"Please enter CVV Number."},
{"field":"PaymentBillingAddress","message":"Please enter your Billing Address"}])

This is actually the server logic just in case anybody needs it

header('HTTP/1.1 412 ' . json_encode($error));

after i open this up in your area I see my custom error message. After I deploy it to some remote server I simply see my custom error message overwritten

Failed to load resource: the server responded with a status of 412 
(Precondition Failed)

It should be some configuration, however i aren't able to find it.

Furthermore, rather than supposing HTTP/1.1

Do that:

header($_SERVER["SERVER_PROTOCOL"]." 412 Precondition Failed");

Rather than this:

header("HTTP/1.1 412 Precondition Failed");
header("HTTP/1.0 412 Precondition Failed");

Why? Because $_SERVER["SERVER_PROTOCOL"] provides you with either HTTP/1.1 or HTTP/1.0 according to your browser. If you are using the incorrect one, apache might add unpredicted content towards the response. eg. a 4 digit hex code in the beginning (checksum?), along with a trailing zero.