Oh, this is interesting, I had added back most of my contacts, and then a few hours later they disappear again. This time the two special ones disappeared too, there was nothing left. And when I checked again an hour later, the two special ones had been added back, but all the other ones are still missing. Luckily, this time I did have a backup, so could just import the backup again.
I might have uninstalled Messenger around the time the contacts disappeared again, and Messenger just like Facebook has an account in Settings -> Accounts. I wonder if maybe something might be broken there, making all contacts disappear when uninstalling an app with an account in Settings -> Account. Should be reproducible if that is the cause. Too bad I deleted my Facebook account and cannot try. But maybe any app that adds an account to Settings -> Accounts are affected?
Or maybe it is just a WhatsApp bug? Or maybe my contacts database has somehow got corrupted?
I will see if I can debug this further. I'll start by seeing if they disappear again, now when I have no more apps to remove. That should give a hint where to look.
BeepBeep I only store the contacts on the device, not any cloud service. And it is not just the view that is wrong in the Contacts app. WhatsApp starts showing phone numbers instead of names since it relies on the contacts provider for getting the names, so the contacts really have disappeared.