My netlify function timeout in production but not in local environment

Currently it is Node v16. This support article gives you more details on our build environment: [Support Guide] Debugging Netlify site builds