PC: "Oh Slaves exist? I want to buy one.
DM: side eye "Sigh. You are unable to find anyone who wants to sale you one."
In my decades of play and DMing I have never had another player want to own a slave and 100% of the time fight to free them. Heck most PCs would rathe throw gold at a hireling and put that paid employee into serious danger.
Any player in a game of mine who decided their PC wanted to buy slaves for their personal convenience, or set themselves as a slave trader, or who treated the slaves of a defeated enemy as loot, would be quickly informed as to where the door was and instructed to make use of it.
However, D&D is a game which allows PCs to come up with their own solutions to problems, their own character background etc. It'd be enormously common, for instance, for a Dark Sun PC to want to free a particular slave. Maybe the slave in question is a loved one or friend, maybe they have useful info, maybe it's a quid pro quo for someone they want a favour from. Rather than trying to brawl with the entire templarate and the slave-owner's personal guards if a rescue attempt goes badly, it'd be a perfectly understandable solution to the problem for them to pool some of their loot (or run a double-cross and steal the slave-owner's loot and use it instead...) and simply attempt to buy the slave and then free them, whether from the existing owner or at the slave market.
At this point, are the PCs guilty of taking part in the slave trade? And more to the sticking point, how much does the slave cost? Because I GUARANTEE that in no universe, ever, is WotC going to put a price list of slaves in a D&D product. And understandably so, too.
That's the real problem. I'm sympathetic to the 'slavery exists to be fought' argument, but with player freedom of action in an open world, dilemmas like this come up all the time.