Lets change your example a bit, my players are walking on a forest, either because I planned it or by random rolling it, they encounter a sick person. What do they do?
Let's make it more like yours, after saving the kingdom they get invited to the castle and they discover the murdered prince. Does it matter if I planned it or it was a random roll? Would you have changed the place where the body was so they found it if they choose not to go into room 3?
The second is a railroad, not a sandbox but I'm not sure it'0s a story and not just setting the scenario for your railroad.
If the players dont go into room number 3, and them finding the prince is the lynchpin upon which the situation is balanced, there are other ways to get the players involved. Of course the players may choose none of them, and of course this may set a course of action for the future.
They may leave, and if they return, find they are wanted for questioning for the murder of the Prince.
They may hear rumors about the princes body being found, and the Kings Guard are questioning people. They could choose to ignore the rumor, or seek audience with the king, or something the GM hasn't thought of.
And if they dont engage with the murder investigation, dont force them by moving the body to room #3. I keep a number of scenarios loosely fleshed out in case the players dont take the bait of my main idea.