I do not think there is any reason for the configuration lost other than unsaving the configuration to the NVRAM before reboot. Make sure that you always save the configuration to the NVRAM so that this can be avoided. And also make sure that you always have a backup copy of the configuration file.