It’s honestly like an odds calculation in those environment. The odds of someone who looks different that is local is incredibly low so they default to assuming said individual is a tourist.
It might be the case in certain Asian countries but in Germany the odds are definitely not incredibly low - something around 40% of the population don’t look like what most people think of when speaking of Germans.