Jackson ended up taking the brunt of the blowback, despite Timberlake obviously deserving at least half of the blame. It was famously dubbed a "wardrobe malfunction" and, apparently, the stunt was supposed to reveal a red lace bra, but things went haywire.
— Tim Marcin, Newsweek, 27 Sept. 2017
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