Some officials worried that disappointed queuers might not make it to the coffin before the state funeral starts on Monday. Or, worse, that in a nation with a deep attachment to orderly queuing, there was the threat of line jumping sparking public disorder. It consulted behavioral psychologists to predict turnout. The government also put 1,500 soldiers on standby in case the line went haywire.
— Max Colchester, The Wall Street Journal, 15 Sept. 2022
Haywire has a literal meaning: the wire used in baling hay, often used to facilitate makeshift repairs. Haywire has a reputation for being difficult to manage, leading to such expressions such as haywire outfit, originally referring to a poorly equipped group of loggers and then anything that was flimsy or patched together, and gradually for attempts gone wrong.
We can thank 20th-century writers such as John O'Hara and William Faulkner for stretching haywire to mean "crazy":
"Why?" the doctor said. "You put up as pretty a scrap against forty or fifty men as I ever saw. You lasted a good two seconds. Now you can eat something. Or do you think that will send you haywire again?"
— William Faulkner, The Wild Palms, 1939