### Describe the bug If a query has ever errored, `getOptimisticResult()` will always return an error status (rather than a pending one) ### Your minimal, reproducible example https://codesandbox.io/p/devbox/winter-darkness-k48yny ### Steps to reproduce 1. Fail a query 2. Try to use `useQuery().promise` somewhere else 3. Component always fails, rather than optimistically fetching when it renders ### Expected behavior If the `getOptimisticResult()` should reflect the actual optimistic result, it should be pending ### How often does this bug happen? None ### Screenshots or Videos _No response_ ### Platform CodeSandbox ### Tanstack Query adapter None ### TanStack Query version latest ### TypeScript version latest ### Additional context Discovered while trying to fix #8499 and tried to fix in the same PR, but will try to have a stab on doing it separately