Parashas Bamidbar · Passuk 3:45
Take the Levites in place of all the male first-born among the Israelite people, and the cattle of the Levites in place of their cattle; and the Levites shall be Mine, GOD’s.
Chabad.org — English translation + Rashi
Source: Bechoros 5a.
English: “In place of their animals” — \ldots and if he has several doubtful firstborn donkeys [the same principle applies].
In context: The midrash extends the exemption rules to cases of uncertainty.
Custom
Chazal apply the substitution principle even to doubtful cases of firstborn animals.