I have my route defined as patients/[userID].tsx
in pages dir.
When I tried to access one of the specific active userID (eg. patients/7917067d) it gave 403 Forbidden
error in prod only, In dev, it is working fine.
FYI, when I enter the wrong userId it gives 404 which is correct behaviour but don't know why only this userId which is correct gives a 403 error.
NOTE: I am using Static Generation with Client-side data fetching
Upgrading the nextjs package to 12.3.3 did the work.
Refer this github issue for more details.