...The misunderstanding has been clarified. It turns out that there is an underground passage from the mages' treasury to the Castle, which I didn't notice during my first descent.
I didn't notice that either. If possible, could you share a screenshot?