I've tried both.
Interestingly, when I select "ARM CMSIS-DAP compatible" in "Tools->Programmer", I get the same error when trying to upload the software. So changing to "STMicroelectronics STLINK" does not change anything.
I also tried with Arduino IDE 1.8.19 and with Arduino Mbed OS Nicla Boards version 2.8.0 and I still have the same error.
The programmers work with Arduino on STM32 boards. Below is a photo