The stability of masses during three-body encounters