Anticipatory grief
Grieving before a death or major change (e.g. terminal illness or the slow decline of dementia). Relief later is common and human.
Everyday example: A carer watching their partner lose memories feels sorrow at each forgotten detail — even while their partner is still here.