This doesn’t really make sense (without modifications) because PlatformIO doesn’t support it out of the box because OpenOCD doesn’t support it out of the box, as discussed in Choosing STLink V2 programmer.
This error is known to appear when attempting to program a fake Bluepill board with a CS32 chip instead of an STM32 chip, as discussed in Debugging of STM32F103 clone "BluePill" board, wrong idcode.