If it worked correctly previously over time cables go bad.There are many reasons for ratcheting so start with the simplest, pull drive and inspect the shift components. In fwd it could be a simple adjustment ,in rev it could be corrosion in the shift slide and no adjustment can correct this condition
worst the cable is bad and needs replacing