I forgot the four digits necessary to unlock my phone once. I’d used them every morning for over a year with no issues. Then woke up one morning, and they were just gone. I never remembered them again. I was 23, but very freaked out because hereditary Alzheimers runs in my family. However, nothing like this ever happened again.
If I forgot my age and had dementia concerns, I think I’d go get checked out by a neurologist. Over here, neurologists can prescribe ergotherapy. I bet there’s something similar in your healthcare system. So if the doctor doesn’t find any medical cause that can be addressed with meds, you might end up going to an ergotherapist regularly to learn about memory exercises and get help with any practical issues that could come up while your memory is suffering.
A brain that’s stressed doesn’t ever perform well. Are you feeling okay emotionally? Because if not, that can definitely have an effect.