Firmware debugging board error - *** [upload] Error 1

I am trying to flash the STM32F723E-DISCO debugging board, here is the log:

Processing disco_f723ie (platform: ststm32; board: disco_f723ie; framework: cmsis)
-------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/disco_f723ie.html
PLATFORM: ST STM32 (15.6.0) > 32F723EDISCOVERY
HARDWARE: STM32F723IEK6 216MHz, 192KB RAM, 512KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES:
 - framework-cmsis @ 2.50501.200527 (5.5.1)
 - framework-cmsis-stm32f7 @ 1.2.5
 - tool-dfuutil @ 1.11.0
 - tool-ldscripts-ststm32 @ 0.2.0
 - tool-openocd @ 2.1100.211028 (11.0)
 - tool-stm32duino @ 1.0.2
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Checking size .pio\build\disco_f723ie\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.0% (used 28 bytes from 196608 bytes)
Flash: [          ]   0.1% (used 344 bytes from 524288 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, stlink
CURRENT: upload_protocol = stlink
Uploading .pio\build\disco_f723ie\firmware.elf
xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2021-10-16-21:19)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

srst_only separate srst_nogate srst_open_drain connect_deassert_srst

target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001284 msp: 0x20040000
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
in procedure 'program'
*** [upload] Error 1

There seems to be an issue with connecting to the debugger.
I also cannot connect to the board through STM32CubeProgrammer.
However, if I flash the board with a project from STM32CubeIDE, everything works and the programmer connects as well.
It appears that something is breaking in platformio.

Can you upgrade the firmware on the DISCO board’s ST-Link to the latest version using

https://www.st.com/en/development-tools/stsw-link007.html

and retry?