Thing is, any fantasy or science fiction has to set the world in which the viewer is being asked to immerse in.
The Harry Potter franchise relied on popular novels, already sold, but was close to source material. The 'world' was fairly unique and it was - from the start - a narrative of the world as well as an episodic story of Harry's involvement in said fantasy world.
In short, the film was based on a single source which gave general guidelines on what viewers should expect.
The Tolkien outings, too, relied on original and detailed source materials with the fans just wanting to see their vision realised.
Even Dune, as science fiction 'behaves' as fantasy in that their world is nothing like our own. That is classic fantasy. Science fiction is fantasy too!
So why does sci-fi succeed where fantasy doesn't? It doesn't.
Science fiction succeeds because the audience feels an extension to the world they are asked to inhabit. A bloke with an implant that he can connect with a public terminal to access the 'net? Not far away. Robots? Yeah; great as an ethical question but we're okay with them. People watch science fiction for 'new' ideas. How far will things go? How will we cope? What will our leaders do with all this new tech? It's all stuff! This is, perhaps, why movie-goers like CGI but start to jeer when too much is used. Too much show, not tell?
Bottom line is, we (the viewer) look at the future as presented and can understand how the world may've got there.
In fantasy (as in wizards, D&D etc.) we are presented with an alternate world where things can be done that, in our world, they don't.
But, an essential issue is the difference between a novel and a film. A novel isn't limited to running time or visual events (involving CGI) in order to draw in the reader. A film has different demands. It can't (or shouldn't) take time over world-building; the modern audience can't be bothered - it wants the CGI action and then some! Pacing in a film is far more important in visual media than in a book.
But the biggest - and I mean THE BIGGEST - problem a Dungeons & Dragons film has to contend with ... is the concept itself.
D&D was popular because it took sword 'n' sorcery written/film material and gave the viewer/audience agency!
You could play a game where, if you thought the hero in a popular story acted like an idiot, you could act out your own plan.
So ...
The modern D&D film-maker is using canon filler ( for example beholders - 'cause they've been popular) to re-invent a much-loved setting (such as Greyhawk) to let the audience watch someone else's adventures ... and then go away and say "I know the setting, I know the spells they had, I could've done this ..."
Hmmmm.