They did? That's news to me.
Toyotomi Hideyoshi banned the buying and selling of Japanese people by Portuguese merchants in 1587. He seemed to have had no problem with his soldiers abducting Koreans as slaves to be shipped back to Japan. Didn't stop Japanese taking each other as slaves in the aftermath of the fall of Ōsaka castle in 1615 either.
There were orders outlawing the buying and selling of people, both before and after Hideyoshi, but they often came with exceptions. For instance, in 1604, the Uesugi clan ordered that:
You should detain anyone who arrives with attendants and no proof of their legal possession. This applies both to people with whom you are privately acquaited as well as people you do not know. You must then immediately report the matter to the local official responsible. The selling of people to other provinces, whether they are men or women, will cease. Sales within the domain are allowed if registered with the local official responsible.
So...yeah.
The Edo Bakufu outlawed straight-up kidnapping and buying and selling of people...only to turn a blind eye to debt slavery and indentured servitude, especially of prostitutes. Which means slavery wasn't really abolished either.