I built a railroad that connects the area where I built my house to a village and used a minecart to transport a farmer from the village to my base area. I had a small house with a bed and a small field with a composter ready and waiting for him. It was broad daylight, and there were no monsters around, but within a few seconds, the villager simply disappeared without a trace. I've read that villagers aren't supposed to despawn, so I can't figure out what might have happened.
For what it's worth, there's also a wandering trader who's been paying me a visit, but while I can hear him, he seems to be invisible whether it's day or night. I don't know if there could be any connection between those two issues, but I figured it was worth mentioning.
Update: I had already tried restarting the game once with no effect, but I did it a second time and the villager reappeared. I have no idea what's happening, but I don't want things to fall apart on me. I'm a pretty new player and this is the first game I've had significant success in.