The Last Place You Looked
The point of Dungeons & Dragons isn’t for the players, or even the Game Master, to “win”. It isn’t a puzzle so insidious that the players give up in frustration. The point of a game of Dungeons & Dragons is to have FUN!
That means the rulebook, the laws of physics, and the text of an adventure can all get tossed out the window if it means that everyone has more fun. Similarly, it is perfectly acceptable for the Game Master to rearrange big narrative moments. If the players are having fun searching and exploring a dungeon, go ahead and move the big battle a little further along. If the players are getting bored and restless, skip the next two rooms and put the magic chest just behind the next door.
The rooms on a map and the text of the adventure are just guidelines. Feel free to add rooms or eliminate encounters depending on the mood at your table. This adventure is a great example. The final “key” to the puzzle can be in any number of locations. So it’s up to you, the Game Master, to feel the mood at your table and decide whether to cut the adventure short or keep the players exploring.