I found out how to fix it! I had this same problem and had no clue what was causing it. But on my realm, only a select few villagers worked. Also, some of their tables that the use to get their professions were lying around and to me, they didn't look ascetically appealing so I broke them. I then tried to trade with the villagers tied to those workstations and the bug happened to them. It turns out that they now need the work stations that they use for themselves in order to properly work now. Hope this helped because it helped me a lot when I found it out!
I found out how to fix it! I had this same problem and had no clue what was causing it. But on my realm, only a select few villagers worked. Also, some of their tables that the use to get their professions were lying around and to me, they didn't look ascetically appealing so I broke them. I then tried to trade with the villagers tied to those workstations and the bug happened to them. It turns out that they now need the work stations that they use for themselves in order to properly work now. Hope this helped because it helped me a lot when I found it out!