In my world, the only villagers I can trade with are the ones that are in villages. I cured a zombie villager... he offers no trades. I made a villager farm... the babies grow up and offer no trades. I used an egg (in survival mode) to create villagers... no trades. When I use a villager egg in creative mode... they offer trades.
seems that newly spawned villagers are "blank" (at least, in cases where the map was generated before version 18w50a; and loaded in the 18w50a version)
seems to be a duplicate of this:
https://bugs.mojang.com/browse/MC-140926