Hello Cessarr,
I’ve realised what was my problem: the board manager I was using in the IDE wasn’t the one indicated for my board. I was using the Seeeduino Xiao one, but after investigating a bit more, I tried using the board manager for Seeeduino Xiao RP 2040 and it works fine now.
Thanks everyone for their help. For anyone with the same problem, follow the steps on this official website: Arduino | Seeed Studio Wiki