I've noticed the same thing - I'll wake up thinking I've got the whole dream locked in memory, but by the time I've grabbed coffee and checked my phone, it's gone. The reason is pretty straightforward: dreams happen during REM sleep when your brain chemistry is totally different from waking life, and there's less norepinephrine (a chemical tied to memory formation) flowing through while you're dreaming. The moment you wake up and that neurochemistry shifts, your brain basically stops recording in that same way, so the dream starts degrading almost immediately.
What actually helps is moving slowly when you first wake up - staying still for a minute, keeping your eyes closed even, and just mentally rehearsing what you remember before you do anything else. Even just thinking through it a few times in your head before getting out of bed makes a real difference in retention. If you want something more reliable, jotting down whatever fragments you can grab works, even if it's just a few weird words or images. You don't need full sentences; just enough to jog your memory later.