It gives the characters just a little problem in plotting how to get out of there.
All the more important in that the story is rolling steadily toward the end. More high drama is needed. Fortunately, not another dragon, but still, drama. . . .
Fairy tales have it easier. A sparser, laconic style doesn't have to do as much to indicate high drama. Not to mention that an event that needs twenty pages in a novel can pass in a paragraph.