Easy! I quickly reached level 10 and captured the castle!
That's exactly the problem: it's desirable to capture the castle before the hero reaches level 10, so that you can then visit all the places that increase skills. Otherwise, after capturing the castle, the mission ends.