"blunder," 1912, baseball slang, probably from bonehead. The meaning "erect penis" is 1950s, from earlier bone-on (1940s), which is probably a variation (with connecting notion of "hardness") of hard-on (1893).
Entries linking to boner
bonehead n.
"stupid person," 1908, from bone (n.) + head (n.). Compare blockhead, meathead. Bone-headed "ignorant" is from 1903. Earlier it was used in reference to types of primitive spears or harpoons.