You shouldnt have driven 5,000 kms with such a problem, Low or No Gear oil is the first cause of gear going back to Neutral, the second cause can be a Faulty gear gharari, in your case a F/F Fault.
Caution : I maybe Wrong, my opinion is based upon my own little experience