Daniel Craig as James Bond in “Skyfall.” (Sony/MGM)

James Bond is one of Hollywood’s most lucrative film franchises. The 007 movies, over a remarkably resilient 56 years, have grossed $6 billion in the United States when adjusted for inflation and billions more overseas.

But the franchise has a major problem: Its best days may be behind it. Of the top five highest-grossing inflation-adjusted Bond movies of all time, only one, 2012’s “Skyfall,” came after 1980. And the franchise’s viewership is getting older — risky in the current moviegoing climate and lethal for any series’ long-term durability.

On top of that, in reaching a new agreement with star Daniel Craig for the next movie, producers Barbara Broccoli and Michael Wilson opted against calls for Idris Elba or another actor of color to play the superspy, and against Elba’s call for a female James Bond, putting Bond out of step with the movement toward inclusion.

Which makes it surprising that “Slumdog Millionaire” director Danny Boyle could direct the next film.

Boyle revealed in an interview with the newspaper Metro last week that he had been tapped to oversee the script and may very well end up directing the 25th Bond installment due for a late 2019 release, taking the baton from Sam Mendes.

The switching of directors suggests a franchise in flux, with uncertainty ahead. And by many standards, Boyle seems, at least from a box-office standpoint, like an odd choice. (Representatives for Sony, MGM and Broccoli-Wilson’s Eon Prods. would not comment on the report.)

But when it comes to Bond it turns out there’s a surprising reality, and it could bode well for Boyle: A first-time director is unusually key to its success.

Boyle, like Mendes an acclaimed Brit, had an unexpected sensation with “Slumdog” a decade ago. But he’s far from a commercial juggernaut. Except for that film, he’s never had a movie gross more than $75 million out of the dozen he’s directed.  His last three attempts were all major underperformers: “T2: Trainspotting,” took in just $2.4 million in the United States last year. Not what you’d expect from a Bondmaster, which requires a touch that will play from Topeka to Taipei.

Also, Boyle is a straight white man over 60 at a moment when the three highest-grossing movies of the previous year and the biggest phenomenon of 2018 all were helmed by someone from a different demographic.

And finally, Boyle is new to the action-adventure category. Sure, he breathed new life into an existing genre with “28 Days Later.” But he’s coming in cold to the world of globe-trotting spies.

But the switch from Mendes to Boyle could be seen as a savvy choice for one simple reason: the very fact of bringing in someone new often is a good idea for a Bond movie. Because, rather unexpectedly, the data suggests a first-time director has a very beneficial effect on a the popularity of 007.

According to a Post review of box-office figures, three of the top four-grossing Bond movies of all time (“Goldfinger,” “Skyfall,” “You Only Live Twice”) in fact came from a director making their debut with the franchise.

Meanwhile, the four lowest grossing movies of all time (“License to Kill,” “The Man With the Golden Gun,” “The Living Daylights” and “A View to a Kill”) all came from directors making a repeat engagement. (All figures use dollars adjusted for inflation.)

And a director taking on Bond almost always does better with his first film than with those that come after. Since original director Terence Young left the franchise for good after 1965’s “Thunderball,” there have been 11 different directors of Bond movies, six of them making more than one movie. All but two grossed more with their debut Bond than with any that came later. And even one of those two exceptions, John Glen, still saw his first and second films gross more than his third, fourth and fifth attempts.

This seems counterintuitive: Bond is comfort food, familiarity. As consumers we’d want, one might expect, to see the spy conduct the tricks he’s done before, maybe with some fresh scenery but with the same basic sensibility, and the same man (sadly it is always a man) overseeing that sensibility.

Why this isn’t the case is tough to say. We may want to see a fresh take from a new filmmaker more than someone going back to a comfortable but well-known well. Or new directors may simply expend many of their good ideas on the first film, leaving them with nothing left on future go-rounds.

Whatever the reason, the results are tough to dispute. While one thinks of 007 as a franchise of longevity — Sean Connery returning to the same character year after year — we don’t want the same things from the movie as a whole. We crave a familiar face but a new person pulling the strings behind him.

Whether Boyle is the right new person of course remains to be seen. It’s far too early to know what he’ll do. (He wouldn’t disclose details of the script, saying simply he  hoped Broccoli and Wilson liked it.) But the prospect of a new Bond voice substantially increases the odds of a Bond hit, just as it did for Mendes when he stepped in to take the reins on “Skyfall” and turned it into a blockbuster.

And if it doesn’t? Then it might finally be time for Elba.