Except that if the roll fails, neither the players nor the GM will know what would have been in the kitchen on a success. It's not like the adventure has the note "if failure, then cook; if success, then empty." There are people here who said that they would have come up with elaborate tables detailing every occupants' location at any given time period, but you know what? I'm not sure I believe that. That would be pages' of pages' worth of extraneous detail for a place that is probably not all that important in the long run, and since some of these people seem confounded at the sheer existence of a cook at at all, it's work that they probably wouldn't have thought to do in the first place.
And as many of us have said before, this is only one possibility. If you think it's a stupid idea that there would be a cook in the kitchen at 2 am, then pick another complication! Squeaky hinges, something in front of the door that gets bonked when the door is open, a cat or dog, a night patrol outside who sees them, a trap that the PC didn't search for, a broken lockpick, a lost item, it takes far longer than usual so they are at risk of running out of time, etc., etc.