You need to disable compression in the Next app: https://nextjs.org/docs/app/api-reference/next-config-js/compress
Then enable it in Frontdoor instead: https://learn.microsoft.com/en-us/azure/frontdoor/standard-premium/how-to-compression#enabling-compression
As an added bonus this will offload the Next app, saving some CPU, and likely making it respond slightly faster.