Except that every other Pirate movie has been a flop, save a few of the better adaptations of Treasure Island, demonstrating the opposite. Pirates of the Carribian is the exception that proves the rule.
But by the time Guardians of the Galaxy came out, Marvel Studios had already earned the general public’s trust. There’s no way it would have been as successful if it had come out before Avengers, and Avengers had that benefit of being based on a preexisting property that the general public would like to be into but doesn’t have the time to. That, on top of riding the success of Iron Man, which was another Pirates of the Carribian success story. It likewise was in a genre that performed poorly at box offices (bar Spider Man), and was saved by a risky (at the time) choice of lead actor who turned out to be exactly who the role needed, the creative freedom to let him make those risky choices, a top-notch script, and a phenomenal advertising campaign.
Don’t get me wrong, I would love it if the D&D movie is a similar against-all-odds success story like Iron Man and Pirates. But the nature of against-all-odds success stories is that, well, the odds are all against them. It’s going to be very hard to convince Studios to roll those dice, especially after previous D&D movies have been so critically and commercially panned. And even if they do, it very well might not pay off.