I believe there’s some issue on Netlify that renders the next-intl library broken. In other words, I don’t think next-intl currently works as expected on Netlify. Here’s an old issue: Next.js + next-intl middleware not setting Link headers on Netlify. So I updated your middleware to drop the usage of next-intl and now I can see the x-theme response header being added correctly: f-146922/src/middleware.ts at master · hrishikesh-k/f-146922. You can see that here: Lucas Mendonça Portfolio.
However, I’m confused about yoour usage of the middleware to set response headers. You can directly use cookies to access the theme: f-146922/src/app/layout.tsx at master · hrishikesh-k/f-146922 which is a clearner and a better way to do what you’re attempting to.