Praise be to Allah.
We have not come across any hadeeth with this meaning, and we do not think that it is saheeh (authentic) or acceptable. There are many saheeh hadeeths (authentic narrations) which warn the Muslim against forsaking or ignoring his fellow Muslim. There are also many verses and hadeeths which encourage forgiving mistakes, overlooking faults and forgiving brothers and friends if they make any mistake. So how can a hadeeth which encourages forsaking a Muslim for no legitimate reason be saheeh?
Ameer al-Mumineen, ‘Umar ibn al-Khattab (may Allah be pleased with him) said:
It is not permissible for a Muslim who hears a word from his brother to think badly of it when he can find something good about it.
Al-Tamheed by Ibn ‘Abd al-Barr (18/20).
Al-Ahnaf ibn Qays said: The right of a friend is that three things should be put up with from him: offences when he is angry, offences due to familiarity and offences made in error. Someone else said: I never reviled anyone, because if a dignified person reviled me, it is more incumbent on me to adopt a forgiving attitude towards him, and if an ignoble person reviled me, I would not give him any extra reason to insult my honour.
See: Ihya ‘Uloom al-Deen (2/183-186).
You should understand that one of the greatest aims of the accursed shaytan (devil) and one of his worst tricks is to instill resentment and enmity among Muslims.
It was narrated that Jabir ibn ‘Abd-Allah (may Allah be pleased with him) said: I heard the Prophet (peace and blessings of Allah be upon him) said: “Shaytan has despaired of being worshipped by the worshippers in the Arabian Peninsula, but his aim is to create troubles among them.”
Hence Allah has forbidden everything that may lead to enmity and resentment among the Muslims. Allah says (interpretation of the meaning):
“Shaytan wants only to incite enmity and hatred between you with intoxicants (alcoholic drinks) and gambling, and hinder you from the remembrance of Allah and from as‑salah (the prayer). So, will you not then abstain?” [5:91]
You can read the hadeeths which criticize the one who forsakes another in the book of al-Imam al-Mundhiri entitled al-Targheeb wa’l-Tarheeb (3/304). In it he has a chapter entitled: Warning against forsaking one another, bearing grudges against one another and turning away from one another, in which he compiled most of what is narrated in the sunnah on this topic.
And Allah knows best.