Added after 15 hours and 6 minutes
I already received an answer to my question from another forum, which might be useful to others, so I will also answer here:
Only the spells that could be in the guild are learned. This includes forbidden spells, but those that are set as mandatory. If the guild of mages is not fully built, only the spells from the built floors will be available. If you allow fewer spells than 5/4/3/2/1 for the corresponding level, the missing slots will be shown as collapsed, and the spells will not be learned. Spells that are forbidden at the map level will not be learned.