Leviticus 25:44-46 Slave buying/trafficking and slave beating Exodus 21:20-21.
First of all, let’s get the correct wording and context. You can read it yourself.
38 I am the Lord your God, which brought you forth out of the land of Egypt, to give you the land of Canaan, and to be your God.
39 And if thy brother that dwelleth by thee be waxen poor,
and be sold unto thee; thou shalt not compel him to serve as a bondservant:
40
But as an hired servant, and as a sojourner, he shall be with thee, and shall serve thee unto the year of jubile.
41
And then shall he depart from thee, both he and his children with him, and shall return unto his own family, and unto the possession of his fathers shall he return.
42 For they are my servants, which I brought forth out of the land of Egypt: they shall not be sold as bondmen.
43
Thou shalt not rule over him with rigour; but shalt fear thy God.
44 Both thy bondmen, and thy bondmaids, which thou shalt have, shall be of the heathen that are round about you; of them shall ye buy bondmen and bondmaids.
45 Moreover of the children of the strangers that do sojourn among you, of them shall ye buy, and of their families that are with you, which they begat in your land: and they shall be your possession.
46 And ye shall take them as an inheritance for your children after you, to inherit them for a possession; they shall be your bondmen for ever:
but over your brethren the children of Israel, ye shall not rule one over another with rigour.
47 And if a sojourner or stranger wax rich by thee, and thy brother that dwelleth by him wax poor,
and sell himself unto the stranger or sojourner by thee, or to the stock of the stranger's family:
48 After that he is sold he may be redeemed again; one of his brethren may redeem him:
49 Either his uncle, or his uncle's son, may redeem him, or any that is nigh of kin unto him of his family may redeem him; or if he be able, he may redeem himself.
50 And he shall reckon with him that bought him from the year that he was sold to him unto the year of jubile: and the price of his sale shall be according unto the number of years, according to the time of an hired servant shall it be with him.