Yeah, I guess I should have banned the construction of the shipyard in this city, but I only found out about this problem nine years after creating the map. Although, it's strange, it shouldn't affect the script like that. It should only take into account the hero's presence in the castle itself, like if he managed to visit the city before the script that destroys the city is triggered.
Yes, I also couldn't acquire the dwarven boots, but it didn't really make it any harder to defeat the demon.