James Holzhauer is setting records on “Jeopardy!” — but he struck out on the ABC game show “500 Questions” four years ago.

The 34-year-old pro gambler, who extended his “Jeopardy!” winning streak to 24 games Tuesday (he’s banked $1,867,142), was a contestant on Season 1 of “500 Questions” back in May 2015 — when he was defeated by champ Steve Bahnaman in the show’s third episode.

While Bahnaman eventually won $110,000, and Holzhauer went home empty-handed, he still impressed the show’s producers with his breadth of knowledge and his game-playing skills — both of which have been in full view during his epic “Jeopardy!” run.

“He didn’t quite manage to knock out the guy in the ‘Hot Seat,’ which was a shame,” “500 Questions” executive producer Phil Parsons tells The Post. “But when we auditioned people [for the show], we did a ‘general knowledge’ test, and James, by far, scored the highest in that test.

“He was quite the tactician, and even in that way he was interesting to watch,” says Parsons. “A lot of people are talking about his top picks [on ‘Jeopardy!’] and concentrating on that, but the thing is you can’t get that far if you haven’t got the knowledge to back it up — and his range was astonishing.”

Parsons notes that Ken Jennings — who won a record $2.5 million on “Jeopardy!” over his 74-game winning streak in 2004 — also competed on “500 Questions” during its second (and final) season on ABC.

Jennings too was sent packing without winning any money.

“James’ test score to get on the show was way better than Ken’s,” Parsons says.

“Jeopardy!” airs weekdays at 7 p.m. ET on ABC.