Seeeduino Xiao RP disconnects from the COM port whenever I try to upload a sketch from Arduino IDE

Hi,
You can try to enter the boot mode to boot record, detailed operation in the wiki: Getting Started | Seeed Studio Wiki