Unpack mtd-utils and run nanddump to check each mtd block and look for "Number of bad blocks".

Could be the eraseblock size not being set correctly. Could be the flash address bus width not being set correctly. Could be Little/Big Endian not being set correctly. Could be bad blocks not being skipped while flash. Could be mtd block not being erased before flashing.

Under Failsafe mode,

flash_eraseall -j /dev/mtd3
firstboot

OpenWrt / configuration not saving
Memory Technology Device (MTD) Subsystem for Linux.