Investigating this further, and reading up on the DUE Bootloader specifics, it seems that the GPNVRAM bit #2 is set to 0 by the ERASE button press, which puts it into a state where it is waiting to be programmed permanently (even after power cycle).
I have been able to perform the following cycle successfully, with the additional command at in step #4 fixing the issue:-
1) Connect DUE via Native USB Port, Select Debug: Hardware, Atmel ICE, Uploader: Atmel ICE
2) Press ERASE Button on Board
3) Upload to Board using Atmel ICE via Visual Micro
4) Run the below command in command prompt:-
C:\ProgramData\vmicro\tools\openocd-0.10.0.20200213\bin/openocd.exe -s "C:\ProgramData\vmicro\tools\openocd-0.10.0.20200213/scripts/" -c "adapter driver cmsis-dap" -c "cmsis_dap_vid_pid 0x03eb 0x2141" -c "set CHIPNAME at91sam3X8E" -c "source [find target/at91sam3ax_8x.cfg]" -c "init; halt" -c "at91sam3 gpnvm show all" -c "at91sam3 gpnvm set 1" -c "at91sam3 gpnvm clear 2" -c "at91sam3 gpnvm show all" -c "reset run" -c "shutdown"
5) Press Reset Button on Board (will try to remove this with commands)
I was running Blink and the LED starts blinking again after the final reset.
Step 4 will give output which contains the GPNVRAM bits, before (first) and after (second) the change (so can undo if needed):
sam3-gpnvm0: 0
sam3-gpnvm1: 0
sam3-gpnvm2: 0
sam3-gpnvm0: 0
sam3-gpnvm1: 1
sam3-gpnvm2: 0
Would it be possible to try this approach on your board, just as a double check before we look at integrating it into the upload commands?