There is only a very limited number of situations I can think of in which it would be fair.
One would be if the rogue rolled low or decided not to take 10/20 on his Search check. Similarly, if the lever was magical and, though they checked for traps, they forgot to detect magic. If there were clues scattered about the dungeon, if the BBEG warned them about the door, if there were piles of dust all around the lever....if there were HINTS as to what it would do, so that a clever character could at least roll a quick check to put the clues together before they were vaporized, then it's fair. Harsh, but fair. The signs were there, and they either weren't found or were ignored. There is a penalty for rolling low, otherwise there wouldn't be a whole lot of GAME to this game. But there should be a fair chance to end the problem without the consequence, otherwise there still wouldn't be a whole lot of GAME to this game.
The other one would be if quick and easy resurrection from dust piles was available. If this was a 20th level game, I'd have no qualms about throwing one of these in there, even without much in the way of hints. I wouldn't spring it from them out of nowhere ("fair chance to end the problem without the consequence", remember), but they can recover from the problem handily enough, without loosing more than a few minutes of game time and a few seconds of real time. They'll loose some time and some treasure, but a quick mention of "I cast True Res" and they're on the way. I also wouldn't have that be the ONLY consequence -- the spell gives the critter in the other room time to prepare, or a wandering monster patrol finds them or something minor but notable that furthers the plot of the game, no matter how nebulous that plot may be. I'm not just syphoning rescources, there's a reason for it to be there.
Similarly, the mention about it being a "high death dungeon," or noting that the PCs will often meet challenges they cannot overcome is under this heading. It's about the tone of the campaign -- if it is somewhat expected, it's fair.
Outside of those two situations, I can't see it being fair. You just killed the character for no good reason. They took all normal precautions. It was obviously far above their level to deal with. they had no reason to expect it and they have no way to recover from it. What was the point of including it?
And because this is a game, it should be fair. I want heroics, not a "life's a crapshoot" lesson.