I am a Myanmar citizen and I have a US visa. When go back to Myanmar I have a long layover (about 20 hours) in Narita and I have to stay overnight there. Do I need transit visa? I am now in Dallas, Texas.
Per TIMATIC, the database used by airlines:
Passengers with a passport and a confirmed onward ticket to a third country within 72 hours can obtain a Shore Pass on arrival if there are no connecting flights on the same calendar day.
So you do not need a visa; rather, by presenting your passport and onward ticket, you can get a 72-hour entry stamp.
TIMATIC is incorrect. Shore Pass is provided only in emergency cases, so it's up to immigration officer. As you are from Myanmar he can decide it's too risky.
Narita airport is closed at night, you have to leave it. So you need a transit visa. If you have no transit visa, you may be forced to stay in guarded hotel paying for hotel and guards.