When you flash the .pio/build/<env>/firmware.bin using STM32CubeProgrammer instead of OpenOCD, does it work?
.pio/build/<env>/firmware.bin