This is kinda true but also kinda not. It glosses over that there are all kinds of "foreigners" and they aren't treated the same or thought of the same. You are using "foreigner" to mean (white) Americans/West Europeans.
I can assure you that Japanese don't feel that way about, say, Vietnamese or Malaysian foreigners. (I live in Vietnam, which has a fair number of Japanese companies. I have a Malaysian friend who left at 6pm one day and had a meeting with HR the next morning at 9am.)
My guess (based on admittedly little real evidence) is that they would also be less understanding of Asian-Americans who leave at 5pm than they are of white Americans who leave at 5pm.
One of the most surprising things I've found living in Asia is the large amount of racism pretty much everywhere. I've seen Chinese restaurants with signs saying "No Japanese allowed". I know a Vietnamese girl who puts in her online dating profile "Don't message me if you are Chinese". Heck, even regional "rivalries" are...rough. I was a cafe in South Vietnam where they refused to serve a group of customers from North Vietnam. The North Vietnamese asked, "Do you have tea?" The staff replied, "Yes, but only Southern tea" and walked away without taking their order.
The person telling me about him said while nobody showed any outward hostility towards him, he was kind ignored when it came to camaraderie between the staff, and perhaps even ostracized in a way. He seemed okay with not being too close with his coworkers though.
At the same time, I wasn't really there, so there could be more to it.
I'm now working in a Japanese programming company (where no one speaks English) and the environment is completely different.
I'll note that the man in this case was Japanese.
A better question is what happens if a young college grad in Japan chooses work no unnecessary overtime?
Just to give you a taste of this: In a previous job in Japan there was a work party on the weekend. I told my boss "I can't got, I have something to do" (A very normal way to refuse something in Japan. The expectation is that no one will ask what your vague reason is). This boss tries to pin me down on exactly why I won't be spending my day off on this event. This leads to 6 months of going over my work with a fine tooth comb, review periods and so on.
I'm surprised your boss tried to pressure you for info. Usually the companies that are more traditional ('non-mandatory' aka mandatory outside activities) will follow cultural norms and just do the punishment without the asking.
N=1 anecdote from a traditionally managed Japanese company.
If you (a twenty-something Japanese man) happen to say お先に失礼します。(announcing you're leaving) at 6:00 PM in front of the company's CEO during a site visit, and the CEO says, in a shocked voice, "I suppose you have somewhere more important to be right now.", and you say "Yes, I'm going on a date.", you can look forward to six months of nuclear-tipped ostracism from your colleagues and, when you complain to management about it, they will tell you "[Foreign employee] is more Japanese than you are; ask him."