Many (including myself) got stuck inside the castle and could never get out because of the flying spears stationed right by the exit. The solution is simple (just like rescuing the princess in Karateka was), different procedure though of course. In Zorro, all you gotta do to escape the castle is...
...just take a bunny hop toward the exit...