NVRAM is protected by CRC, which means that upon system boot Netos calculates the CRC and compares it with one previously stored in FLASH calculated during most recent write.
The NVRAM would reset to defaults as you’ve described in 2 cases:
-user requested Reset of NVRAM in serial dialog or through iDigi (or software purposely or accidently calls “reset NVRAM” customizeUseDefaultParams(nvParamsPtr)
-during boot NVRAM CRC check fails and systems decides it needs to reset NVRAM to default values.
This can be caused by accidental FLASH write to NVRAM sector (due to memory leak in code or file-system growing too much for example). Another reason could be a bad FLASH, where read of some blocks is inconsistent. But the most common reason for this to happen is when power-cycle or external reset was triggered during the legitimate system write to NVRAM. If such even comes when system already wrote the new variable to NVRAM but before new calculated CRC was updated there, the CRC check will fail after reboot and system will reset the NVRAM structure to default as designed.
Does your system has to do frequent updates to NVRAM? Can they be eliminated? Was the size of the NVRAM sector increased? Do you use FLASH filesystem? You can consider implementing backup NVRAM sector that will be copied to the main one instead of reset to defaults.