Realistically best to plan for a 24 hour stay given no way to predict delays to inbound flights, delays through immigration and then find your return is leaving on time but you still need to exit customs and check in again.
Of course if your inbound arrives in the morning and the return departs in the evening that’s a different scenario, but still recommend 24 hours.