This is likely due to Next attempting to pre-render the Suspense
boundary, despite the useSuspenseQuery
falling under a client component (https://nextjs.org/docs/app/building-your-application/rendering/client-components) -- since the pre-render attempt is missing the client's headers/cookies, it is presumably failing your authorization.
Some notes on Suspense
behavior with useSuspenseQuery
can be found here: https://tanstack.com/query/latest/docs/framework/react/guides/ssr#a-quick-note-on-suspense.