Lol. "A foreigner? What are you doing here?". Walking around, dude. Is she not allowed?
Probably bad translation, there is an issue with a lot of western stuff translating things in a way in English that looks or sounds racist when it wasn't in the original language
You've also got to be aware of language barriers, Japanese people might not know it would sound like that to English speakers if translated
And inevitably even when you're trying not to accidentally put something bad sounding in you'll end up with something had sounding that you're not aware of
There are also cases where someone will misinterpret 「外国人 (gaikokujin)」 or "foreigner" in english as being racist when it's literally just a descriptive word and a translation can cause that misinterpretation