It was narrated that Mundhir bin Jarir said:
"I was with my father in Bawazij and the cows came back in the evening. He saw a cow did not recognize it. He said: 'What is this?' He said: 'A cow that joined the herd.' And he issued orders that it be driven away until it disappeared from view. Then he said: 'I heard the Messenger of Allah (ﷺ) say: "No one gives refuge to a stray animal but one who is also astray."
English reference: Vol. 3, Book 18, Hadith 2503
Arabic reference: Book 18, Hadith 2599