It seems like a common detail for both situations is both travelers were at a land crossing. It sounds like a nightmare scenario but I bet they also could have been bounced back and forth between the guards of either country. At that point, one side will have to take on detention responsibilities because neither side will trust the person to make good on their return plans.
It would be great if articles on the matter could include research on the scenario you describe. FWIW, ChatGPT tells me the German tourist could likely have returned to Mexico.