No leaving transit area, regardless of circumstances. If you don't take a room at the airside hotel for an overnight transit, SA Immigration will throw you into a detention cell instead (and believe me, you don't want to wind up in one of those EVER!).