Age by itself isn't a risk factor for hip dislocation. But age added to mental confusion is linked to hip dislocation. Post-operative confusion is not uncommon in older adults after surgery. It may or may not go away but it usually takes a few weeks to a few months.
It may be necessary to have some extra help at home during this recovery time. Check with the doctor first to make sure there isn't a medical cause for the confusion. Sometimes drugs or drug interactions can cause confusion. Changing the drug or the drug dosage may be all that's needed.