The fact that you had to unlock the STM32 before you could flash it, could mean it has been used before. Did you buy it from China? I flashed a few KFF's but never had to unlock the STM32. But I sometimes buy programmable chips from China, always advertised as "brand new, genuine and unused" and all of it has been proven to be untrue.
Same happened to me when I ordered from China and at the time I was working on my dumper tool I use to order from China in hope that they came read protected. (RDP1 or RDP2) Usually they came with RDP1 but I also once got an RDP2 protected chip which required double glitching to get the firmware out. One funny thing is that this RDP2 protected chip could also be downgraded to RDP1 and then RDP0 by erasing the content so the chip worked flawlessly after this. Info from STM states that after setting RDP2 it would be impossible to downgrade again
And in case some one is wondering how to dump a read protected chip then wallet.fail did a great job on this that was introduced at CCC some time ago. This is of course only the first step but helped me on the right path.