Say Anne is 10 ft away from and fighting Grogo the dwarf fighter, Grogo has Sentinel and Polearm Master. Grogo still has his reaction. Anne has a reach weapon, so she and Grogo are pretty much on a contest of who can skewer the other first.
Now Bets the Hired Sword wants to get in the fray and take a shot on that tough Dwarven skull. Bets is allied with Anne, so Bets can move through her space. Bets moves, and enters Anne's space, and takes a pike to the knee from Grogo. Now Bets has zero move, but haven't finished moving yet, and now has 0 move while inside an ally's space.
Assume all eight spaces around Anne are free. Bets moved into Anne's space from behind (the one opposite from Grogo's).
Where does Bets end up?