This is a very common symptom and should be expected to occur at some point, especially in the last weeks/days of life.
Possible Causes
Dehydration
Shortness of breath
Side effects from medications
Pain
Constipation, Urinary retention. Especially in patients with Dementia
Infections: agitation likely, especially if fever is present. Urinary tract infections are very
common
Lack of sleep
Psychological issues: increasing fear of death, unresolved conflicts, and depression can
also present as anxiety