Be careful with the turn indicator. When it is the mouse's turn, the mouse-win condition is "any move leads to a mouse-win". For the cat, it is symmetric. The loss condition is when all moves lead to the opponent winning.
This happens when the degree reaches zero without finding a winning move. Test your code on small examples first. Verify terminal states are detected correctly and propagation works as expected.