I hope you got all that? Clear now?Nope , sorry!
Close to bed time is Bonne nuit!
Chuns and who ever is interested :
Bonsoir , first thing first is only when you arrive, and you're meeting someone not when you're leaving, which will be then Bonne soirée.
Now, sometimes people just don't think. A cashier might say bonjour when it's time to say bonsoir, just because saying it 500 times.... He or She becomes a machine, that's all.
In summer let's say by 7.00 / 7.30 people are supposed to say Bonsoir. The day is over ok ? Many a time youngsters or people I meet on the stadium said Bonjour instead of Bonsoir. And I always sort of correct them by saying: "Well if you don't mind my evening is going to start, I've had enough with my working day which is now over so bonsoir suits me better". And very ofter people say , oh yes you're right the working day is over.
So think working day, it will be the best help.
It's about the same thing with Bon après-midi , Good afternoon.: It sounds like an evidence to me : After Noon! Après Midi ! So let's say that nowadays people have lunch a tad later but deffo at 1.00 it is After Noon , isn't it?
So from 1.00 when you are meeting someone you still say Bonjour till 7.00pm but when leaving that person you can say Bon après-midi!
Is it clear? Does it sound logical?
EDIT
I forgot in winter, it will become more spontaneous to say Bonsoir earlier just because the night comes earlier, so don't be surprised