Next.js sitemap.xml returns 404 on Vercel production with dynamic data

updated sitemap with the try catch blcok. check below deployment logs.

BUILD LOGS

Route (app)

┌ ƒ /

├ ○ /_not-found

├ ○ /about

├ ● /audio/[slug]

│ ├ /audio/how-to-become-close-to-allah

│ ├ /audio/why-dont-we-see-the-promise-of-allah

│ ├ /audio/hashar-hisaab

│ └ [+71 more paths]

├ ○ /robots.txt

└ ƒ /sitemap.xml

ISSUE

navigating to sitemap still gives 404 page not found. I cant even see the path being logged on vercel.
I tried npm run build locally. Sitemap is working fine except on vercel