First, realize you do NOT need to know who is lying and telling the truth!
A lot of people THINK it’s about finding out which one is lying and telling the truth.
And the guard telling the rules does not count as part of the riddle and not grounds to determine who is lying or telling the truth. This is not the point of the riddle. You have to forget about trying to find out who is lying. That isn’t the point.
The trick is NOT to find out which one is lying and which one is telling the truth but to find out how to get them both to give the same sort of answer.
If you ask one guard ‘Would he (the other guard) tell me this door leads to the castle?’ Whatever answer they give you is the opposite of the truth.
You’re either asking a truthful person what a liar would say (So you get a lie answer, you're truthfully told what the liar would say.). Or you ask a liar what the truthful person would say (so get the lie answer because that's who you're talking to, lie by default).
Remember what Hoggle said, you have to ask the right questions.
Sarah got it right, she only fell through the trap door because she had made the mistake of saying ‘It’s a piece of cake.’ An oubliette is not certain death and she only ended up there because she chose down as opposed to up.
The one thing Brian Henson is wrong about is on the two disc DVD set he mentions Sarah got it right (which is true) but not understanding why the ground gave out under her anyway. He figured it was because life isn’t always fair and she had to learn that. Though that can be considered a lesson the fact is she said ‘It’s a piece of cake.’ Something always goes wrong when you say that.