The locals usually donate food & supplies to the crew.
https://www.charlestoncitypaper.com/story/how-a-charleston-p...
That level of cognitive disconnect surely can't be held up as valid in any legal system that has greater cognitive ability to do 'connect the dots drawings'.
And the other is that the port authority wants the ship gone, and not vandalized or becoming a hazard to navigation. So they will require someone to stay on board to maintain it and keep it secure. Which can include getting Immigration to forbid the crew entrance to the country. While they are in port, it's much like being in the secure area of an airport - they're in a gray area and aren't actually in any country. So when that happens, it is illegal for them to leave it.
There is a mariner's charity in Greater New York that would help out. They would post a bond with ICE and drive the sailor to an airport or another ship.
Well, whether 9/11 security or what, they weren't allowed to do this. So the captain had been on the ship for over a year.
So, yes, it can happen here.