If a foreign national is denied entry to Japan and then is deported from Japan, the foreign national must immediately leave Japan. According to Article 59, Paragraph 1 of the Immigration Control Act, the captain of a vessel or aircraft or the carrier who operates a vessel or aircraft (or the carriers of such foreign national, or, in most cases, air carrier, if the foreign national boards an airplane) shall assume the cost and responsibility for the foreign national’s deportation from Japan.
If a foreign flight passenger is denied landing Japan, he/she will usually face difficulty in boarding the same aircraft to leave Japan. In this case, such foreign passenger will need to stay in Japan for a couple of days until the most immediate flight is available to leave Japan.
In this sense, according to Article 13-2 of the Immigration Control Act, special inquiry officers or supervising immigration inspectors may authorize such flight passenger to stay in a hotel or any other accommodation near the port/airport for a limited duration. As the foreign passenger is not authorized to land Japan in this case, his/her going out from designated accommodation will constitute illegal entry or illegal landing.
(source: Immigration Services Agency of Japan)