openOCD flash 'erase_sector' command NOT erasing lpc1768?
You forgot:

reset init


Background: The LPC1768 maps a ROM bootloader by default at addess 0x0. The reset init handler in recent OpenOCD version does the remapping to flash memory.