In discussing redeeming a Jew who has sold himself to a non-Jew as a slave, the Torah directs us to make an accounting of the remaining years of servitude until the Yovel to determine the proper redemption amount. The commentaries say you must deal fairly with the non-Jew even if he is from one of the nations you have subdued and you have power over him.
The Rambam learns from this posuk that it is forbidden to cheat even a non-Jew, and you must make careful calculations in business. To do otherwise would be an abomination and desecration of G-d’s name. However, he rules that if the non-Jew was the one who made the calculation, and he made an error, the Jew may say, “I rely on your calculation” and benefit from the mistake. But, if he instead points out the mistake, and brings glory to G-d’s name, showing the Jewish People to be men of honor, he is praiseworthy.
The B’er HaGolah, in Choshen Mishpat 348:5, strongly advises against taking advantage of this loophole. He says: “I am writing this for the ages, that I have seen many people prosper and grow wealthy on the mistakes of Gentiles but they did not see success as their money was ultimately lost and they did not leave anything after them for their children. However, those who returned such monies made a great Kiddush HaShem and they prospered and grew wealthy, saw great success and passed along much wealth to their descendants.” [See also Maharsh”a kesubos 67a]
