I saw this solution on the XIAO official via using the raspberry pi.
but I did not use it, coz I know this way is the same with use SWD to burn the firmware into XIAO.
So I really recommend you use the XIAO expansion board to connect with the XIAO, but you need to get a J-link device and download the J-link software. I have used this method to solve the problem, absolutely work.
Like this Jlink device I’m using, and I mark the arrow that means you need to connect to SWD on the XIAO expansion board.
Put the bin file on the J-link software then burn into XIAO, done.