If I understand correctly, you unlock the bolt, and pull it back only part way and the firing pin goes forward. I don't see how that can happen.
Now if you pull the bolt back all the way and start to close it and the firing pin goes forward, then your have a problem either with the cocking piece or the sear. The sear may be damaged or something is causing it to not engage. Is the sear/mag catch spring in place and properly seated?