Upvote:6
Transiting through Narita without passing immigration requires the flights to be on the same calendar day. The next day is not the same calendar day. Narita is not open 24 hours, which is why you cannot do this.
You will need to go to immigration, request a shore pass, and leave the airport. This is allowed if your connecting flight is within 72 hours.
Note that this does not cover coronavirus related travel restrictions. There is currently a long list of countries from which Japan will refuse entry if you have been to them within the previous 14 days. See IATA Travel Centre for the most current coronavirus travel information.