Definitely.
Especially when you try to record it, hit the first chord and find it's the wrong one or the wrong sound and bang - the thing has gone out of your head.
I have had some success in getting these things "out of my head". The key is to keep away from any instrument as much as possible, instead relying on what you're hearing in your head. I find that hearing something else just throws me off completely.
So..
1. Describe the song on paper. Write down what instruments are playing, what type of sound they're using. How the tune sounds. This exercise alone should solidify the song more in your head.
2. Determining the key, or the first few notes. Try humming the first note, then play it to determine the key (unless you've got perfect pitch of course, in which case you'd know already). But don't try any more at that stage in case you lose what's in your head.
3. If you can write notation, get a notation notebook and write down what you can (assuming you've got the key from step 2).
4. Once the tune is more clear in your head, you can try either humming the parts into your smartphone/dictaphone or if you're more confident, try recording it using a real instrument.
Obviously everyone's brain is different, and this may not work for you, but I find it helps me in most cases.