I don't know if this came up the first time around (I'm old, you know), but there was an earlier sense of whack in US of "A bargain or agreement. Esp. in phr. it's (or that's) a whack."

1876 ‘Mark Twain’ Tom Sawyer vi. 70 I'll stay if you will.’ ‘Good—that's a whack’.

...so it's not too great a stretch to think that "out of whack" at first was used for "out of agreement".

but here's the first citation: 1885 C. A. Siringo Texas Cowboy v. 33, I was too weak to walk that far on account of my back being out of whack.

[all citations OED]

{apologies to jazz}

-jimmy (whacko) locke