Are the devices joined via OTA or ABP?
How do you shutdown the device? Pulling power will not allow the database to be backed to flash.
The database is backed-up to flash on a 1 hour interval.
Try to backup the database after adding your nodes.
$ nc -u localhost -p 6677
database backup
There will still be an issue for downlink counters if the power is pulled without backup. Uplink counters can be caught-up when power is back. But the downlink frames will be rejected until the counter exceeds the previous value.