When looking through glass pane, possibly glass block, with a closed trap door in front of the glass, all entities in view disappear. They reappear when looking away from the glass block.
Linked issues
Attachments
Comments

Attached a couple screenshots with villager entities, showing looking at glass pane and not looking

Created video showing issue, uploaded to youtube. Issue maybe be due to villagers standing on soul sand.
Cannot confirm. Can you attach a screenshot and/or video of the issue?