Mesa v Hernandez was not decided based on the idea that people outside the US have zero rights in US courts. It was decided based on the insane principle of qualified immunity being applied to law enforcement when they violate somebody's rights in a way that is not absolutely completely identical to some prior case where a court determined that the action violates rights.
There was case a while back where a border patrol agent in Texas shot a person in Mexico. No ability sue.
The constitution only restricts the government (some exceptions), and is therefore unusually silent in where the government isn’t the government.
This is unfortunate, because the US government absolutely operates in foreign countries.