I have had two cases where a villager that I have resurrected has despawned after a certain amount of time. After trading a few times the villager is gone from the room I keep it in. (The room doesn’t give the villager a way to leave because it uses a redstone door that can only be activated by a button.)
Duplicate of MC-153904. If you have any more details about this issue, please comment on that ticket. We're currently trying to find the source of this issue and haven't found it yet.