The expression "to pull a boner" comes from the old American minstrel shows. There was a man in these shows who was called Mr. Bones because he carried two small sticks of bone that he used as an instrument. He was asked questions by one of the other men in the show, just to get stupid but funny answers. This became known as "pulling boners." But in time, the expression, "to pull a boner," meant something more than getting an answer to make you laugh. It meant a bad blunder a mistake that was costly. And a man who pulled such boners was often described as a "bonehead."
Father: Ah, I pulled a boner.
Sergent: Don't pull a boner.
Bomb Squad Member: Alright.
Ususally phrased "pulled a boner".
Why the word bone or boner means mistake, I have no idea:
Perhaps from accidentally hitting your funny bone, acting like a bonehead; or a grave robber pulling out a bone instead of jewels from a grave...just guessing!
Nowadays if you tell someone you "pulled a boner" they might think you are gay if you are a man or horny if you are a woman!
I thought that black guy on the phone was white--pulled a boner on that one!
Don't pull a boner this time you dope!