Same serial number to each device is not recommended way.
Rather, no serial number is better.
When two or more devices of the same serial number of the same VID/PID are connected to single PC at the same time, Windows is confused to identify the devices. It may fail on the second device. For no serial number, Windows identify them at the USB ports to which the devices are plugged in.
On the Windows side,
IgnoreHWSerNum registry setting makes Windows ignore the difference of serial number. Instead, Windows see USB port 'location'. With this setting, all your VCP devices are assigned to the same COM port number, as long as they are plugged into the same USB port.
At a guess it is using the Unique ID of the STM32 as a USB serial number. The PC will then enumerate each uniquely. Hard code an alternate, constant, serial number.
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..