Device was upgraded to21.4R3-S5.4 and there are some config which is not supported on 21. version and that the reason device is going into Amnesiac mode after the reboot. Once such config was Duplicate IP.
dcd[4149]: %CONFLICT-4-DCD_PARSE_WARN_INCOMPATIBLE_CFG: [edit interfaces ge-0/0/1 unit 0 family inet address X.X.X.X/24] : Incompatible configuration detected : identical local address is found on different interfaces
The device didn’t boot into amnesia mode, instead junos is booted properly, only config db is corrupted due to config errors.
dcd[4149]: %CONFLICT-4-DCD_PARSE_WARN_INCOMPATIBLE_CFG: [edit interfaces ge-0/0/1 unit 0 family inet address X.X.X.X/24] : Incompatible configuration detected : identical local address is found on different interfaces
As in newer version of junos duplicate IPs are not permitted, we can delete the duplicate IP and then reboot the device.
Its matching some of the following PR
https://prsearch.juniper.net/problemreport/PR1555861
https://prsearch.juniper.net/problemreport/PR1221993