You should be passing customs before midnight for that flight so no problem, go through by 11pm chill with a coffee or beer before you board. Safe journey home
If you have a reentry stamp always show it first. I have a multiple and always do that and never had a problem. Bkk or DMK if not easy to buy before you go but little bit more money to do on return, goot staff will point you where to go 🙏