The same name appears twice, but the second occurrence refers to another bearer of that name without identifying a particular one. That indefinite use is why the text allows full declension.
The key distinction is identifying a specific person versus referring to an unspecified bearer of a name.