If you are on a cart going out of a mine with a locked gate directly on the tile border on the edge of the cave entrance, the cart can leave the mine and stay on the other side of the gate (outside the mine other side of the gate) but the owner is thrown off the cart and remains locked inside the mine. Carts should not be able to pass that locked gate.
Below is a photo of the stuck cart, the cart and horses was on the other side of the gate while the owner was on this side of the gate, not able to pass the gate nor able to access the cart or horses.
How to reproduce: Build a locked gate on the edge of a cave entrance. Attempt to drive through the gate with a cart, while you don't have gatepass permission.
Result: Cart will get stuck on the other side of te locked gate outside the cave while the driver will be glitched back into the cave.