useQuery function stuck on pending status randomly - TanStack