Test on small examples first. For a -vertex graph, you can trace the entire game tree by hand and verify your code's output. Print the state graph for small inputs. Verify terminal states are marked correctly. Use assertions to check invariants: every state should eventually be marked as winning, losing, or drawing.
If not, your algorithm has a bug. Start by printing the game state at each recursive call. Check that terminal positions return correct values. Verify your transition logic matches the game rules exactly.