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

Exactly that. When I try to upload a sketch in dev mode, the Xiao turns into removable disk mode. If I click reset, I get into dev mode again and the removable disk dissapears, but whenever I upload the sketch I get the same problem.