When God (in verse 45) said that slaves are ok to buy, he meant that people, all from the start, each have slaves within their hearts. Things that we have sold or boughtten that are forced to pick our “moral cotton.” God calls for us to set these free, free our hearts from slavery.
And as God goes on to explain the logistics of buying and selling slaves…
You’re taking those passages too literally: