Never thought about the origin of the common meaning until now.
According to radio four, it dates from American logging camps in the
19th century. Haywire was the precursor of baler twine, so there was plenty around in the days of horse power. Naturally, it was used for bodging anything which broke.So a "haywire" camp was one that was more than usually dependent on....haywire