OP, this is just an incredible story and a very sad one. So sorry to hear about the trouble here. I have no advice to offer that's any better than the other commenters. I only hope that your case was truly an anomaly.
However, I've noted a lot of the responses in this thread discuss Japanese xenophobia and the immigration officer's unwillingness to be helpful for something that was about to change in just a matter of days. Not to say that this isn't the case, but I'm old enough to remember when Northwest Airlines started flights from Tokyo to Portland, OR in 2000 and quickly became known in Japanese circles as "Deportland" as they regularly would deny entry to Asian travelers at dramatically high rates compared to other ports of entry. There was even an incident of strip-searching a businesswoman with what seems like little to no cause. At the time I was living in Tokyo, and my Japanese colleagues basically refused to take that flight (Northwest was our corporate airline at the time), and they would take other connections, even longer ones, to avoid it.
I, myself, was looking forward to a trip to Japan next summer. I'm hoping that I don't have to rethink that - especially when traveling with my family.
Seattle Times article:
https://archive.seattletimes.com/arc...1&slug=4041807
NY Times article:
https://www.nytimes.com/2000/08/31/u...h-the-ins.html