I mean to be fair, they're only based on the Medieval Era superficially. Fantasy medieval times is completely made up and constantly changes depending on what the author wants to do with it, so that's not really an excuse for the author to normalize slavery in their works.