Unemployed villagers and nitwits shake their heads when the player attempts to trade with them, which is not the problem. The potential problem is that an employed villager will do the same animation when attempted to be traded with. Trading seems to still work though, and the problem only seems to happen after a trading attempt has been made while unemployed. The problem goes away after leaving and reentering the world (at least in singleplayer).
Environment
Windows 10 Pro 64 bit, Intel Core i7 Q 720 @ 1.60GHz, 20.0 GB of RAM, Nvidia Quadro FX 880M, Java 1.8.0_51 64 bit
Duplicate of MC-147479.