In this case, Esperanto follows the Germanic tradition of having a separate morning greeting (good morning, guten morgen, god morgen) and using "good day" in the afternoon. That's different from Romance languages, which use "good day" (bom dia, buenos días, bonjour, bonjourno) as their morning greeting.
This is how my teacher put it:
05:00 - 12:00 - Bonan matenon
12:00 - 19:00 - Bonan tagon
19:00 - dark - Bonan vesperon
dark - 05:00 - Bonan nokton
I can't imagine (based on more than 2 decades speaking Esperanto) saying "bonan nokton" as a greeting no matter what the hour. Possibly if someone was leaving a gathering and going back to their room to sleep, I might say "bonan nokton", but otherwise it would be "bonan vesperon" or "saluton."
I'm pretty sure that in German, you never say Gute Nacht, unless someone is in their pajamas and walking up to their room. (Slight hyperbole, but only slight.)
Becaude it’s the same concept and the Esperanto ‘tago’ comes form the German word ‘Tag’.