Well, perhaps they are hiding in the broom closet from a group of mischievous poltergeists. While in there, they discover a map on the wall that shows the location of all the secret passages in Hogwarts that they didn't know before. This could lead to a new adventure where they explore these passages and find new allies or solve some of the mysteries of the castle. Also, they could be in the broom closet looking for a broom for Hermione to use in a Quidditch match, and instead find a magical broom that has a special ability, like it can fly without a rider to deliver messages.
A plot idea could be that they are in the broom closet because they heard some strange noises coming from it. Inside, they find a small, injured magical creature. They then have to use their knowledge of magic to heal the creature and figure out where it came from. This could lead to a new friendship with the creature and a new understanding of the magical ecosystem in and around Hogwarts. Or they could be in the broom closet when they are suddenly transported to a different time in Hogwarts' history and have to find a way back while also learning some important lessons about the past.
One idea could be that they find a hidden passage in the broom closet that leads to a secret part of Hogwarts, like an old library or a room full of forgotten magical artifacts. They then have to figure out how to use these artifacts to help them in their fight against Voldemort. Another could be that they get locked in the broom closet by a spell gone wrong, and while they're in there, they find a diary that reveals some long - forgotten secrets about Hogwarts founders.