1.  One cause of the backrest not locking is the locking pin does not come out far enough to engage.

2.  Lightly grip the pin end of the locking pin with a pair of pliers.  Place a wrench on the nut side of the locking pin.

3.  Turn the nut counterclockwise to lengthen the locking pin.