Are major mystery subplot(s) in a fantasy story distracting or make a story more appealing?
Here is an examination of the structures of Harry Potter that concludes the first four books, and the sixth, are all structured as mystery stories, wrapped in fantasy.
The first four books of the series are definitely the mystery stories he’s [another literary critic] referring to, the “who is up to no good and what are they trying to accomplish.” The mysteries are all neatly there in the titles. What is the Sorcerer’s [/Philosopher's] Stone and who wants to steal it and what for? What is the Chamber of Secrets, who would open it, and what might be inside it?
Also #3 The Prisoner of Azkaban, #4 The Goblet of Fire, and #6, The Half-Blood Prince, are structured as mysteries.
A mystery structure can keep readers engaged just to find the answer; gathering up the clues and trying to interpret them just like the characters are, getting excited by the sparks of understanding and figuring things out along the way.
A similar structure is being used currently in the TV Series The Magicians, which I follow, although the crew there is not as cohesive as the Harry Potter crew (in The Magicians singles or pairs go off on their own tangents, but eventually the whole crew always seems to get back together). But they are pretty much always trying to solve some mystery or another.
Solving a mystery is a great motivation (as it is in Harry Potter) for characters to wander and explore the setting, poke their nose in places where it does not belong, eavesdrop on conversations and search for secrets, get into trouble for all that, and even to become targets because others are trying to keep the secret, or beat them to the solution.
To keep them from being distracting, do like Harry Potter does, and use a lot of your fantasy elements and other imaginative inventions to distract the reader from the mystery. In other words, in Harry Potter, the kids are always discovering new things about the setting and other characters, they aren't only solving a mystery.
So you keep the clues, setbacks, and confusions of the mystery, but make sure that is not all the protagonists are learning and seeing and experiencing as they try to solve the mystery. The mystery cannot provide all the revelations and wonders of your world, even if the quest to solve the mystery is the reason these other revelations and wonders are encountered or experienced.
Every book has some book-driving problem for the protagonist to address, a mystery is just fine as such a problem. But, also be sure, like any other book-driving problem, the protagonists have a very strong reason to solve the mystery. It should be crucial to them to crack it, or it won't feel crucial to the reader, and then may seem like a distraction.