Don't panic ..
I have seen this a couple of times and it was because the rifle was 'cocked' but not far enough to activate the sears properly ... sometimes it sounded cocked as it went over the abt. Maybe you did not 'yank' the lever hard enough to get the safety to engage?
I have always thought this a weak part of the engineering as you should not need to yank on the lever.
A solution I found was :
1. had this problem with mine. found it was the piston and spring guide touching removed half a mill from top of guide and it cocks as easy as you like now
So maybe worth checking.

Also note that the end flange on the spring guide needs to be no more than 2.8mm thick or it impedes the piston rod engaging on the sears. Maybe a previous owner has had a fiddle / added extra parts?
Also, assuming you are not getting spring bound.
Good luck
Cheers, Phil