in an iPhone with both sim (as default) and eSim (as secondary) contacts that are associated with eSim (secondary line) are being reaassociated with the default line when changing phones.
eSIM Contacts association
We appreciate your interest in participating in the forums! These forums are for questions about developing software and accessories for Apple platforms. Your question seems related to a consumer feature and is better suited for the Apple Support Communities
https://discussions.apple.com/welcome
Albert Pascual Worldwide Developer Relations.