If a Wandering Trader moves to a slime block or is spawned (via command or egg) on a slime block, trying to trade with him while he is on top of the slime block will cause the trade UI to open and close instantaneously.
If the Wandering Trader falls on a slime block however, the UI works as expected.
Normal villagers don't seem to have this issue.
One way of reproducing:
Place down a slime block
Use the Wandering Trader Spawn Egg on the top side of the slime block
Attempt to trade and notice the UI not staying open
Duplicate of MC-44349