Zaydun akhūka: nominative antecedent and nominative badal with wāw.
Zaydan akhāka: accusative antecedent and badal with alif.
bi-Zaydin akhīka: genitive antecedent and badal with yāʾ.
Badal follows grammatical case, not necessarily the same visible ending. The latter two are teaching examples.