The "pathfind" feature (wander_target) in "wandering trader" does not work when "wandering trader" is on top of another "mob" using the "ride" command. "illagers, piglin brute" with similar "pathfind" function works even when you're on something, so it seems like a bug that "wandering trader" stops working.
How to reproduce:
On any world go at 0,0, create a plateform with the following command:
/fill 0 100 0 10 100 10 stone
Then teleport on the upper corner of this plateform, so to 10 101 10:
/tp 10 101 10
Summon a Wandering Trader on a Horse targeting the block 0 101 0:
/summon horse ~ ~ ~ {Passengers:[{id:"minecraft:wandering_trader",WanderTarget:{X:0,Y:101,Z:0}}]}
What happens:
The Wandering Trader looks downward, and the horse starts to move very slowly. After some seconds, it stops to move and start to spin on itself indefinitely. This is due to the fact the Wandering Trader doesn't actually touch the ground, so it assumes it hasn't reached the right Y layer, and continue to try to reach it.
Expected behavior:
The path should be drawn from the horse's feet, and The Wandering Trader should be satisfied when the horse is near the location 0 101 0.
Thank you for your report, however, your issue duplicates MC-266798.