You have two possibilites:
1: The gun is fitted so tight that the locking piece is jammed into the ramp on the back of the upper receiver and refuses to budge.
Tapping with a hammer and wood along with maybe a few whacks on the underside of the stock with the palm of your hand may loosen it up enough to pop free. Removing the pivot bolt in the front may also loosen things up a bit.
2: The locking piece is rusted in place.
Do you know how to remove the stock? Under the buttplate is a slotted nut that fits over the recoil tube and holds the stock on and the recoil springs in the tube. They make a tool for this that keeps the springs captive but a normal large screwdriver and care can be used. Once the buttstock is slid off the recoil tube the mechanism is exposed and you can douse it with oil to loosen it up.
If both solutions fail, remove the small screw back there that retains the lever and pull it out. This will expose the side of the locking piece and you can get a hammer and punch at it to knock it loose.