Destinguish between internal error code and service error code

Is there a way to distinguish between an internal 503 error from traefik being unable to talk to a service and a 503 status code returned from a service? Drupal uses a 503 code to say "I'm in maintenance mode" which conflicts with the 503 triggered internally by traefik if a service isn't available. Both seem to get routed through the error page middleware with the same code making it difficult to provide useful content on the error page. Best I can tell skimming through traefik's code 503 is a special case in this regard and I don't see a way to do this.

Have you found a way to solve this issue?