Staff Sgt. Robert McKevitt, left, was fired from his civilian job after reportedly using a forklift to get candy from a vending machine. (Rodney White/Des Moines Register)

It’s a familiar tableau: an overpriced vending-machine candy bar dangles on a spiral hook, tantalizingly out of reach and refusing to drop.

For most of us, that mini-drama usually ends in defeat. But not for Robert McKevitt of Spirit Lake, whose victory over an uncooperative vending machine ultimately cost him his job.

McKevitt, a staff sergeant in the Iowa National Guard, was working the second shift at Polaris Industries’ warehouse in Milford, Iowa, when he decided to break for a snack last fall.

He says he deposited $1 in a vending machine, selected a 90-cent Twix bar, and then watched as the candy bar crept forward in its slot, began its descent and was abruptly snagged by a spiral hook that held it suspended in midair.

“I was, like, ‘Oh, man,’ ” said McKevitt, 27. “So I put in another dollar, and then it wouldn’t do anything.”

At first, McKevitt’s frustration took the customary route: He banged the side of the machine. He tried rocking it back and forth.

But when that didn’t work, McKevitt walked away and commandeered an 8,000-pound forklift, according to state unemployment compensation records.

He reportedly drove up to the vending machine, lifted it 2 feet off the concrete warehouse floor — then let it drop. He allegedly repeated the maneuver at least six times, by which time three candy bars had fallen into the chute for his retrieval.

When a supervisor confronted him, McKevitt allegedly explained he was simply trying to get the snack he had paid for.

He was fired five days later.

In a ruling that became public last month, a state administrative law judge denied his claim for unemployment benefits, saying McKevitt had demonstrated a willful disregard for his employer’s interests.

McKevitt, who served in Afghanistan in 2011 and is a member of 1st Battalion, 194th Field Artillery, didn’t testify at his Dec. 16 unemployment-benefits hearing.

But he told The Des Moines Register he never lifted and dropped the vending machine.

He says after shaking the machine to retrieve the elusive Twix bar, he used his forklift to move it back in place against the wall.

“That machine was trouble,” he said. “They fired me, and now I hear they have all new vending machines there.”