The game crashes when a ridden entity is trying to ride its own rider.
How to reproduce
First you need an entity that can ride itself, so it needs to have a rideable component that references its own family, i've used the slime as an example:
Next you can either use the /ride command (1) or give the entity a behavior.find_mount component (2).
Summon two slimes.
(1) If you're using the command, make sure you mark the slimes with different tags so you can select them properly, e.g.
Next, make one slime ride the other. So far everything works as intended.
Now, reverse the riding without dismounting the slimes first. The game will freeze and crash shortly thereafter.
Interstingly the game doesn't crash if you specify the teleportRule argument as teleport_ride.
(2) If you're using the component, the slimes will path towards each other and as soon as they merge, the game freezes and crashes shortly after.