The bug
Loyalty tridents sometimes seem to disappear (or actually disappear) when thrown right before the player travels between dimensions. They behave very inconsistently, and almost randomly.
In most cases, the trident stays as an entity in the dimension it was thrown in, and promptly returns to the owner. However, it might also fail to return, in which case it might go through the portal and end up in the location of the portal in the overworld.
Sometimes, the trident seems to disappear, but is actually teleported to a specific location in the world, which seems to be near world spawn. It might stay as an entity (despawning eventually due to MC-125817), or drop as an item.
Expected behavior
The trident should always return to the player, or drop as an item in the spot as soon as the player teleports, which is what happens if you die before the trident returns (MC-176919).
Attachments
Comments 3
I can't seem to reproduce this in 23w41a, the trident properly gets returned to me every time I've tried (I have tried more than once):
Of course, there would be the edge cases of tridents thrown in the Nether on End dropping into lava or the void and being destroyed. Maybe a better solution would be to just return the trident to the player's inventory after they teleport, but that would be a feature request and inconsistent with the behavior of tridents thrown before the player dies.