off the rails
In an abnormal or malfunctioning condition, as in Her political campaign has been off the rails for months. The phrase occurs commonly with go, as in Once the superintendent resigned, the effort to reform the school system went off the rails. This idiom alludes to the rails on which trains run; if a train goes off the rails, it stops or crashes. [Mid-1800s]
Dictionary.com presents 366 FAQs, incorporating some of the frequently asked questions from the past with newer queries.