Depends on your flight habits. I fly from Los Angeles to Bangkok. My stop usually is Taipei unless I take Thai Airways which is a direct flight. I plan my flight to arrive around 10 am to 3 pm. Earlier the better. Since my flight takes off at 11pm to 1 am I sleep as much as I can during the 13 hours to Taipei. 2+ hours stopover, eat, walk around, clean up. Then 2.5 hours to Bangkok and I try to nap if I can. I have a short vacation because of work. So I leave on a friday night/sat morning arrive Sunday there. It allows me to unpack and take a nap and go out on the town.
Arriving from Midnight to 3 am, the airport is open, I would book a late arrival hotel anywhere if you are not staying in Bangkok. If you are, book a late arrival.
The cab drivers pay for a permit to pick up at the airport, very unlikely to be dodgy. To always have a fare come to you without driving around. It's money in their pocket to have that permit.
The airport link train stops at midnight so forget that.
Just take a taxi no big deal.