So I rebuilt the test with the arduino-pico library under arduino ide, this defaults to pid 0x000A. This now generates the same write error so the problem is GUI-O usage of the CDC driver.
I then disabled flow control in the test:
Serial.ignoreFlowControl(true)
And GUI-O now works. So I think the problem is you are not asserting the DTR line when using the CDC driver.
[edit]
Since I can see no way to ignore flow control with the mbed core I will await you to change GUI-O to assert DTR. Incase it isn't obvious without DTR (DataTerminalReady) asserted no arduino will send data down a serial connection with flow control enabled, which it is when using the CDC driver.