I tried different things even uninstall and reinstall STM32CubeIDE but nothing works. What finally works for me was select "ST-LINK (OpenOCD)" instead of "ST-LINK (ST-LINK GDB Server)" in Debug Probe in "Ält/Run/Debug configuration/Debugger". Besides...