Дварим 15:18 Мидраш: Sifra

לֹא־יִקְשֶׁ֣ה בְעֵינֶ֗ךָ בְּשַׁלֵּֽחֲךָ֙ אֹת֤וֹ חָפְשִׁי֙ מֵֽעִמָּ֔ךְ כִּ֗י מִשְׁנֶה֙ שְׂכַ֣ר שָׂכִ֔יר עֲבָֽדְךָ֖ שֵׁ֣שׁ שָׁנִ֑ים וּבֵֽרַכְךָ֙ יְהוָ֣ה אֱלֹהֶ֔יךָ בְּכֹ֖ל אֲשֶׁ֥ר תַּעֲשֶֽׂה׃ (פ)

Тебе не покажется тяжело, когда ты отпустишь его на свободу; ибо вдвойне от найма наемника он прослужил тебе шесть лет; и Господь, Бог твой, благословит тебя во всем, что ты делаешь.

Sifra

6) — whence we derive that one who was sold to a gentile has the upper hand (in the reckoning). Whence is it derived that when he is sold to a Jew, when he is redeemed he has the upper hand? From "hired man" (here) - "hired man" (Devarim 15:18, with respect to one who is sold by beth-din) — a gezeirah shavah (identity) — Just as with "hired man" mentioned in respect to (his being sold to) a gentile, he (the servant) has the upper hand (in his redemption), so, with "hired man" mentioned in respect to (his being sold to) a Jew, he (the servant) has the upper hand in his redemption.