The Rambam wrote in chapter 5, law 5: Two people who deposited two males with a shepherd, one a בכור and the second a פשוט, and one of them died—the shepherd places the second one between them and departs, and it is a doubtfully-sanctified בכור, and the two of them divide it, for neither of them recognizes his own. Thus far his words. And so wrote the Tur and Shulchan Aruch. And it must be understood, for in Bava Metzia (37a) the Gemara establishes that this deals with a case where they deposited them with the shepherd without his knowledge; for if they had deposited them with his knowledge, he would not be exempt by placing the living one between them and departing, for it would be incumbent upon him to recognize whose animal died, and if so, he would need to pay from his pocket for the one that died, see there. And this was explained in Choshen Mishpat, siman 300. And so wrote the Tosafot regarding this law in Bekhorot (18a, and see Lechem Mishneh). Why then did they not explain this? However, in truth, here this is not the issue, for this pertains only to monetary laws, but regarding the matter of the בכור there is no practical difference; for ultimately, this living one is a doubtfully-sanctified בכור and the two of them divide it and eat it according to the sanctity of a בכור when it develops a blemish. And also the other living animal that he would give from his pocket when they deposited with his knowledge, they would also divide and eat as non-sacred meat. Therefore, since regarding the law of the בכור there is no practical difference, they did not mention this here.
כתב הרמב"ם בפ"ה דין ה' שנים שהפקידו שני זכרים אצל הרועה האחד בכור והשני פשוט ומת אחד מהם מניח הרועה השני ביניהן ומסתלק והרי הוא ספק בכור ושניהן חולקין אותו שאין אחד מהם מכיר את שלו עכ"ל וכ"כ הטור וש"ע ויש להבין דבב"מ (ל"ז) מוקי לה הש"ס דמיירי כשהפקידו אצל הרועה שלא מדעתו דאלו הפקידו מדעתו לא היה נפטר במה שמניח החי ביניהם ומסתלק דעליה דידיה רמי להכיר של מי מת וא"כ צריך לשלם מכיסו בעד זה שמת ע"ש ונתבאר זה בח"מ סי' ש' וכ"כ התוס' בדין זה בבכורות (י"ח ועלח"מ) ולמה לא ביארו זה אמנם באמת בכאן אין זה ענין דזהו רק לדיני ממונות אבל לענין הבכור אין נ"מ דסוף סוף זה החי היא ספק בכור ושניהן חולקין אותו ואוכלין בקדושת בכור כשיומם וגם החי האחר שיתן מכיסו כשהפקידו מדעתו יחלוקו ג"כ ויאכלוהו חולין ולכן כיון דלדין הבכור אין נ"מ לכן לא הזכירו זה בכאן