Rava said: An ox that is itself a tereifah [mortally afflicted and unable to survive] which killed [a person] is liable [to be stoned]. An ox belonging to a man who is a tereifah, which killed, is exempt, for Scripture says, "the ox shall be stoned and its owner also shall be put to death" (Exodus 21:29) - wherever you can read in the verse "and its owner also shall be put to death," you can read "the ox shall be stoned," and so on [but where the owner could not in principle be liable to death, neither is the ox]. Rav Ashi said: Even an ox that is itself a tereifah which killed is also exempt. Since, were the owner [in such a comparable case] exempt, the ox too, when it kills, is exempt.
When a Mortally Wounded Ox or Owner Does the Killing
Yalkut Shimoni on Torah 340:8
אֲמַר רָבָא, שׁוֹר טְרֵפָה שֶׁהָרַג, חַיָּב. שׁוֹר שֶׁל אָדָם טְרֵפָה שֶׁהָרַג, פָּטוּר, דַּאֲמַר קְרָא הַשּׁוֹר יִסָּקֵל וְגַם בְּעָלָיו יוּמָת, כָּל הֵיכָא דִקְרִי בֵיהּ וְגַם בְּעָלָיו יוּמָת קְרִי בֵיהּ הַשּׁוֹר יִסָּקֵל וְכוּ'. רַב אַשִׁי אֲמַר, אֲפִלּוּ שׁוֹר טְרֵפָה שֶׁהָרַג, נַמִי פָּטוּר. כֵּיוָן דְּאִלּוּ בְעָלִים הֲווּ פְטִירֵי, שׁוֹר נַמִי כִּי הָרַג פָּטוּר.