Corrupted excel file

When I download an Excel file from my backend node.js app hosted on netlify, the file is corrupted.

However, when I download it from a locally running app or hosted on Vercel, the file is okay.

I tried to debug and add logs to compare the first, and last bytes of the file and size, and it’s the same locally, vercel, Netlify.
Though logs are the same, when I download a file from Netlify it’s around 20Mb more than a file in Vercel, however in the logs file size is the same. So seems like netlify does something to the file.

Could anyone help me with this issue?