Sorry, but debugging with mbed studio is really crap compared with the STM Cube IDE.
Even when it works without errors and gdb server crashes, you cant dive into mbed library sources because the source code files are not found by the studio. And the next debugger crash is just a matter of minutes…
All this works reliable with the STM IDE. I managed to set up a project using mbed 5.14 with STM32 NUCLEO-L432KC by exporting a project from the mbed online compiler and importing into STM IDE. Some work with missing include pathes and a few missing symbols had to be done, until it compiled with only two warnings about deprecated functions, but nothing magical.
I think the current STM32CubeIDE upgrades the stlink to a version which is incompatible with previous stlink versions, which causes other tools not to work with stlink. So you might try the ST-utility to update stlink to another version of stlink firmware.
I have the same issue on STM targets with programs built using Mbed OS 6.6.0.
Changing the STM-Link firmware revision did not help.
One way how to recover such board is to erase the chip’s flash memory with the STM32CubeProgrammer. Make sure you keep the Reset button pushed on the Mbed board when clicking on the Connect button on the STM32CubeProgrammer. Otherwise it won’t connect. When connected you can release the Reset button. Once the board is recovered you can continue to use it with Mbed OS 6.5.0 or earlier.