Contacts sync to your email account or accounts, they are not under your iPhone’s or Apple's control unless they are iCloud-hosted contacts. This means that if you lose contact with your email account or accounts, when you tap a contact and there is no connection to the email server the contact will be removed. So verify that you have the correct email username and password in Settings/Mail/Accounts on each email account. And if you have recently deleted an email account or changed the password that would explain the symptom you are seeing.