Create a setup as follows:
[media]Place a glass block above the green terracotta block, and hit or kill one of the villagers.
Try to trade with the other villager.
Result: The villager will not change the prices of their trade. This also happens when placing 3 glass panes in a line, as well as with blocks like slime, honey, leaves, snow layers above 6, and even the lectern. (I'm guessing due to the weird shape of the bounding block, its' treated as a full block). Doors and Trap doors are debatable (they have holes, but the door/trapdoor model doesn't reflect that, I think).
I know why it's happening, though - the object model is blocking the line of sight, but I would think that villagers should be able to see the villager next to them be hurt.
Environment
Java 1.15.2 (haven't tested in the snapshots)
Please check if this is still an issue for you in 1.16 Release Candidate 1 or later.