Throwing error not resulting in react-query capturing 'error' state - TanStack