A node has three states, not two: white (never touched),
grey (on the call stack right now), and
black (fully explored, and proved clean). A
grey → grey edge is a cycle; a grey → black edge is
ordinary re-convergence. Collapse the two into one visited bit and the
algorithm starts reporting cycles that are not there.
n — which shares no machinery with the DFS above, so it can disagree with it.