Regarding the missing/deleted device. Can you add a function, which checks the referenced devices in the assistantDevice for existence in the config. You had something like that in the gBrigde plugin I remember, when I deleted a device from pimatic which was part of the gBrigdeDevice.
To go a step further what you thing about this. Nice would be a info toast after clicking okay in the assistant device.
Devices are valid
when everything is okay
Devices are NOT valid. Device X is not part of the config.json!
when something went wrong.
Just an idea. I will really take care for such stuff in future!