Ending 3 requires a specific wrong answer to the mechanical dragon puzzle. If you can figure out the right answer, you can probably guess what the wrong answer is.
Solving that puzzle just comes down to reading carefully. Most people will rush through that room to get to the puzzle and try again, but that's a mistake.