Mistake 1: Forgetting to take mod after each operation. This causes overflow and wrong answers.
Mistake 2: Not handling negative results in subtraction. Use ((a - b) % m + m) % m.
Mistake 3: Trying to divide directly instead of using modular inverse. Division does not distribute over mod the way addition and multiplication do.