歯車が狂う(はぐるまがくるう)

Japanese vocabulary

Meaning: to go wrong; to go awry; to go off track; to go out of whack

See it used in real works