My XIAO SAMD21 sketch compiles but does not upload

If you are rewriting the bootloader, the following will be helpful.
How to unbrick a dead XIAO using a XIAO(DAPLink) and OpenOCD

How to unbrick a dead XIAO using ST-LINK and OpenOCD - #40 by msfujino