The reason for this is that Netlify workers is running on Deno, not Node like "regular" serverless functions. The official Sanity client builds in support for using stuff like XHR for older browsers, features that Netlify Edge functions doesn't know about. Hence the official Sanity client will cause a Netlify Edge function to crash.
Note that you might be able to polyfill XHR and other js features not supported in Netlify Edge functions, but for this use case you don't need to.
Swap the official Sanity js client for picosanity. This client is written for modern browsers only and works well with both the Netlify Edge runtime and the Cloudflare workers runtime in my experience. Most notably it doesn't rely on XHR.
Note that picosanity only supports performing queries.