This is probably caused by differences in the PFCR register setting in the initialization routine of the external flash write program and the user program.
The external flash memory program download, memory modification and software break settings that are set for the external flash write function are written to the external flash memory when the program is executed.
The external flash write program prepared by the user is used to write to the external flash.
If the PFCR and other register settings included in the initialization routine in the external flash write program differ from those settings in the user program, those register values are re-written during the external flash memory write.
To resolve this problem, either make sure the register settings in the external flash write program initialization routine are the same as those in the user program, or make changes only to the affected bits.