The trades of villagers of the same variety are sometimes copied over to other villagers of the same variety, overwriting the previously available trades of those villagers and resulting in many villagers with identical lists of available trades. The village in the world in which this bug was encountered is a large one (expanded from a smaller one) with many villagers and doors in a desert biome. This has occurred multiple times even after culling off most of the village population and allowing them to breed to restore it.
To reproduce, create a large village and trade with the villagers multiple times. View the trades of all the villagers. Some may have all the same trades available, even when there are a large number of potential trades.