Thanks for pointing me to that library. It has a different, more low-level approach than NanoBLEFlashPrefs, right?
With NanoBLEFlashPrefs the stored values survive reflashing your sketch. And it uses a SoftDevice so you do not need to worry about radio notification or timing issues.