Lots of the time when I try and trade with a villager it won't let the trade go through but either: letting the item go into my inventory then taking it out whenever I leave the trading interface, not letting me trade it at all, or the trade goes through but doesn't give me an item. This happens usually with the higher-tier trades, but it has happened to me for any type of villager or any trade. I haven't been able to buy diamond armour or enchanted books at all. I would attach a screen shot but I'm not sure how that would work.
EDIT: I also live very close by to the village, forgot to mention that. Also there are discounts when I try to trade for these items. This bug basically makes the trading aspect of the game unplayable for me. If you have questions feel free to ask!
I believe MC-148454 is your problem.