Definitely the way how entities are being saved is not stable and need to be checked. Yesterday I complained that my horse with armor and saddle disappeared with no reason after I have re-logged my SSP world. Today I enter my brewing room I found my only one librarian villager was duplicated. Both librarians and with the same offerings as of my last trade.
It's impossible for a villager to have entered that room (underground, by iron door); the closest village is 800 m away. I got my librarian by curing a zombie villager and trapping him in that room.
Sorry, this bug is irreproducible. It happened randomly.