"stupid person," by 1899, American English, from knot (n.) + head (n.). Joe Knothead is the name of a character in an 1857 blackface satire publication. And a local history from Massachusetts published in 1879 describes an old-time character known as knot-head because "[d]uring the hottest days of summer ... he worked bare-headed in the sun ...."
Knothead also was used as a term in cattle and sheep raising, defined in 1922 as "a type of poorly bred, stunted northern cattle, about the size of yearlings, but with heavy horns indicating that they are older." It turns up, however, in an 1849 petition to the Ohio Legislature, recommending a certain person for a court position, in part because he is a knot-head, which the report of the petition notes is a term of praise for a judge because they are asked to untangle knotty legal questions, but which phrase, it adds, "is believed not to be in use among gentlemen in the north part of the State." [Appendix to the Journal of the Ohio House of Representatives, Session of 1848-9]