The bug
The trading window remains open when a villager moves outside of the interaction range.
How to reproduce
Spawn a villager and a zombie
Start trading with the villager
→ ❌ The window stays open even after the villager left the interaction range
The trading window in the screenshot belongs to the villager in the right corner.
Linked issues
is duplicated by
relates to
Attachments
Comments
Cannot reproduce.
Affects 1.13-pre1
Confirmed for 1.13.1.

Confirmed in 1.16.1.
Can confirm in 20w48a
Can confirm in 20w51a.
Can confirm in 21w03a.
Can confirm in 21w05a.
Can confirm in 21w06a.
Can confirm in 21w07a.
Video attached.
Can confirm in 21w15a.
Can confirm in 1.17.
Can confirm in 1.17.1.
Can confirm in 1.19.
Can confirm in 1.19.2.

This thing can kill so-called "Void Trade Halls"... it is interesting to know other players' reaction.
Is this still a concern in the current Minecraft version 14w18b / Launcher version 1.3.11 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.