Maybe the battery was just disconnected and when you pressed the switch you connected it again. If that is the case, it was working as designed.
BTW, the switch is supposed to be spring loaded and kept in the NEUTRAL position, neither ON nor OFF. You have to press the switch to either ON or to OFF to cycle the relay, then the spring returns the switch to NEUTRAL.
Now, this is dependent on us talking about the battery disconnect switch. If we are actually talking about the switch to link the two batteries together to boost a weak battery, it IS supposed to be spring loaded to the OFF position.