UA is correct. You are not transiting (a return to origin on a separate ticket is not a transit), you have a single ticket whose destination is Japan, and since you are not permitted to enter Japan, you would be denied boarding.
There was a long discussion about a similar situation on the BA board recently.
It is not UA that is responsible for this, but the decisions of the government of Japan.