I would book a flight to Bali on the same day. I recommend booking a flight with Garuda to minimise the hassle of changing terminals. I also recommend at least 3 hours between flights.
Having said this, there are some interesting places to see in Jakarta, but 1 night is not worth it in my opinion because you would spend a lot of time on the roads due to the extremely bad traffic.