This exception fires when you try to call a std::function object that is empty (perhaps because it has been default-inialised or cleared).
Perhaps when you load a preset, the waveshaper function is being cleared somehow.
Another possibility is that there is a data race on this function object. If you’re loading the preset on the main thread while the waveshaper is being used on the audio thread, you may need to add explicit synchronisation to avoid a race.