Usually that is one of two things. One is a shift module, not too expensive. Two is the main shaft has lost teeth, very expensive. If the pan is dropped and it is full of metal chunks, it is the shaft. It can be a few dozen other things that are also on the not too expensive side. It needs a good transmission shop to find out which you have. It might be more expensive than the car is worth, so be prepared for that.