I don't know how you programme or whether your programming solution uses CubeProg. What happens if you programme with CubeProg and perhaps switch off the option Shared as a test?
Well, I don't know which tool Simulink from Mathworks uses for programming, so I can't comment on that. But let's take another look at ST-LINK: can you please upload a photo of your ST-LINK, front and back?