What device OS version have you got on that device?
Have you had that device ever joined to a mesh?
It should not be required, but you could try flashing this code, run it once and then flash your own code again
#include "Particle.h"
#include "dct.h"
SYSTEM_MODE(SEMI_AUTOMATIC);
void setup() {
const uint8_t val = 0x01;
dct_write_app_data(&val, DCT_SETUP_DONE_OFFSET, 1);
pinMode(D7, OUTPUT);
digitalWrite(D7, HIGH);
}