J.E. Lighter, Random House Historical Dictionary of American Slang (1997) gives as a first occurrence of "off the wall" in a slang sense this exchange from a 1937 scare film, cited (with interpolated commentary) in Michael Starks, Cocaine Fiends and Reefer Madness (1982):
After the usual prologue on the perils of marijuana, we find Lamont High school students Jimmy and Sally drinking in a local bar ("Beer 5¢"). "Oh, Jimmy—you don't love me. I'm off the wall." Evidently, Sally is trying to tell us that she is drunk.
"I know Sally, but I don't mind." "In the old days parents knew what their kids were doing evenings." "If my mother and dad had come to places like this, I wouldn't be here now." The rest of the gang, reportedly including Lucille Ball, is drinking, necking, and fighting, while being looked over by obvious older pusher types.
Lighter analyzes this excerpt as follows:
The sense of the bracketed 1937 quot[ation] is unclear; perh[aps] it implies "only a wallflower." Current meanings [of "off the wall"] are not attested before 1953.
The opening of Lighter's entry reads like this:
off the wall adj. odd or eccentric; crazy; (broadly) obnoxious, offensive, pointless, etc. Also as adv.
And Lighter's first two attested citations are as follows:
1953 in [Mike] Leadbitter & [Neil] Slaven Blues Records 201: Off the Wall [name of a song on Checker records—U 4348, listed as "Chicago, 1953"—by Little Walter & His Jukes] 1959 F[rank] L. Brown Trumbull P[ar]k 354: We all said thanks in our own off-the-wall ways. Ibid. 223: Not that off-the-wall holyroller kind of clapping.
Frank Brown, Trumbull Park (1959) actually has three instances of "off the wall," each time as a hyphenated adjective phrase. First:
"You can't beat the syndicate."
Seemed like Terry had to keep coming up with those off-the-wall remarks. I was getting sick of this cat:
"What goddamned syndicate?"
I don't know whose church radio program it was that was swinging so nice that January Sunday morning. I mean, organs and choirs and people clapping—not that off-the-wall holyroller kind of clapping, but that happy-in-time easy-going everything-together kind of clapping. Whosever church it was, it was going.
Arthur looked up and laughed sort of quick-like and pulled at his ear; and one by one the brave ones, the not-so-brave ones, the hip ones, the square ones, the men and women—one by one, we all said thanks in our own off-the-wall ways:
The two 1950s citations suggest that the phrase may have arisen in African American slang before crossing over to white U.S. slang. I remember that "off the wall" was a popular term in the small east-coast college I attended in the early-to-mid-1970s—popular enough, in fact, that my friends and I had a routine where, whenever someone alluded to something or someone being "off the wall," we would immediately pretend to attach ourselves magnetically to the nearest wall by both hands and both feet, and proclaim that we were "on the wall."
In 1978, in law school in Texas, I encountered a related phrase: "off the page." Our torts professor told our class that in assigning marks for each answer on the final exam, he awarded 5 points for an excellent answer, 4 for a very good one, 3 for an above-average one, 2 for an average one, 1 for a below-average one, and 0 for an answer that was "off the page."
Harold Wentworth & Stuart Flexner Dictionary of American Slang, first edition (1960) doesn't list "off the wall," but it does show that "off the wall" had plenty of company by 1960 as a phrase beginning with off and meaning "crazy":
off adj. Crazy; eccentric; loco. See off [one's] chump, off [one's] head, off [one's] nut, off [one's] onion, off [one's] rocker, off [one's] trolley.
These expressions have in common that the middle term is a possessive pronoun instead of the word the, but otherwise they seem quite similar to "off the wall." Wentworth & Flexner also cites "off the cob" (meaning "corny") from the 1940s. I have sometimes wondered whether "off the wall" was suggested by the sad fate of Humpty-Dumpty, but I've not found any support for that idea in reference works.