This is the problem . . . the Bible is not a code of correct human behavior.
It doesn’t take a position on slavery. Why would it?
It’s a book about the movements of spirits through eternity, and the divine governance of the earth.
From this perspective, a human slave might be well positioned to do something quite extraordinary and useful- cf. Joseph, Esther, etc.
We are all slaves, in NT theology, until Jesus sets us free. In the New Exodus narrative template, that begins the Christian slog through the desert, toward the Promised Land, which is the coming Kingdom.
Not about “good” and “bad” behavior, or our judgements about which is which in the lives of other people.
Making moralizing judgements, you might not turn to Rahab for help. But she is the one with the power to destroy the city.