It is not permissible for a Muslim to undersell his brother, because it is proven in al-Saheehayn that the Prophet (peace and blessings of Allah be upon him) said: “No man should sell over his brother.”
The wisdom behind this prohibition is that it provokes enmity and hatred among Muslims, and everything that leads to enmity and hatred among Muslims is haram, because of the general meaning of the verse in which Allah says (interpretation of the meaning):
“Shaytan (Satan) wants only to excite enmity and hatred between you with intoxicants (alcoholic drinks) and gambling”
Allah has stated that the reason for the prohibition on alcohol and gambling is that it leads to enmity and hatred for those who do those things.
If a Muslim undersells his brother, is the transaction valid or not? There are two scholarly points of view. Some of them said that it is not valid, which is the view of the Hanbalis, and some said that the transaction is valid but sinful, which is the view of al-Shafi’i (may Allah have mercy on him).
Ibn Qudamah (may Allah have mercy on him) said in al-Mughni (4/149): If he goes against that and does the transaction, then the transaction is invalid, because it is forbidden, and the prohibition implies that it is invalid. And it is possible that it may be valid, because what is forbidden is offering his product to the buyer or saying something for which he cancels the transaction before the transaction has been completed, and because if the annulment of the transaction which causes harm is valid, then going ahead with the (second) transaction should also be valid, and because the prohibition has to do with protecting the rights of another person, so it is similar to artificial inflation of prices. This is the view of al-Shafi’i.
Al-Mardawi said in al-Insaf (4/331): it is not permissible for a man to undersell his brother, which means saying to one who has bought a product for ten: I will give you something similar for nine. And it is not permissible for a man to falsely tempt (outbid) his brother, which is when he says to someone who has bought a product for nine: I will give ten for it, in order to cancel the sale and make a deal with him. There is no difference of scholarly opinion concerning this. This may occur in two cases: before the two parties conclude the deal and part, or when the deal is conditional. … In answer to the question “If he does that, is it valid?” there are two views, both of which are narrated in al-Furoo’ and elsewhere.
1 – It – i.e., the second transaction – is not valid. This is our point of view, and it was classed as sound in al-Tasheeh. It says in al-Madhhab wa Masbook al-Dhahab: the transaction is invalid according to the apparent view. It says in al-Furoo’: It is not valid according to the more correct opinion. It says in al-Ri’ayah al-Kubra: The better known view is that it is invalid. This view was favoured by Abu Bakr and others, and it was confirmed in al-Khalasah, al-Wajeez, and Tadhkirat Ibn ‘Abdoos. It was also given precedence in al-Sharh and al-Kafi.
2 – It is valid. This was the view favoured by al-Qadi and Abu’l-Khattaab. Shaykh Taqiy al-Deen said: It is haram to outbid one’s brother, and if he does that the first purchaser has the right to demand the product from the seller and take the extra amount or compensation. End quote.
See: al-Mawsoo’ah al-Fiqhiyyah (9/214)
Al-Shaykh ibn ‘Uthaymeen (may Allah have mercy on him) said: The words “the transaction is invalid” clearly show that the transaction is not valid, but some of the scholars say that the transaction is valid, because the prohibition here does not refer to the trade goods, rather it refers to something else, namely the transgression against the rights of another Muslim, so the transaction is haram, but it is still valid. This may be proven by the fact that if the one who undersold his brother gets permission from the one whom he undersold, then the transaction is valid and there would be nothing wrong with it. Therefore, the transaction is valid but sinful.
But to adopt the view of the madhhab is better because it prevents people from transgressing against the rights of others. End quote from al-Sharh al-Mumti’ (8/206).
And Allah knows best.