I am trying to remember a point and click game that was first person and you started outside of a castle. When you left the castle the gates closed behind you. The end of the game is when the gates are open and you leave the grounds.
What type of game was it? Educational puzzle like Castle of Dr. Brain or a RPG dungeon crawler like Stonekeep?
It was very similar to Myst.