Why does the Torah refer to "Ez" which is feminine, when "v'Hikrivo" later in the Pasuk is masculine?
Ramban #1 (citing Targum Onkelos), Moshav Zekenim and Targum Yonasan: The Torah is referring to the species (the species of Eiz), 1 not to the goat itself.
Ramban #2, Moshav Zekenim: The Torah is simply not particular about gender when it comes to animals, seeing as in most cases, there are not different names for the male and female species. 2 Consequently, even where are different names, 3 we find that the Torah will refer to Seh and Shor 4 even when it refers to a female animal. 5
Such as Gamal, Chamor, Shafan Arneves and Chazir among the animals, and Tor and Yonah among the birds (Ramban).
Such as Shor and Parah, Kesev and Kisbah, Tayish and Eiz (Ramban).
Instead of Kisbah and Parah (Ramban).
See for example 22:28. (See also Ramban who cites other examples).