You're prolly right that you psyched yourself out... that's totally happened to me too.
The other thing I find is when I'm, uh, "up and down" a lot before the actual sex, I have a much harder time staying up.
As far as your friend goes, I guess it depends on the kind of girl she is... if she's mean, I suppose it's possible that she has a laugh at your expense. But if I think more likely is that she might think it's her fault. And from what you're saying, it's really not.
"Try again" sounds good to me too. If this keeps up for the next, say, dozen times, then yeah, maybe it's worthwhile talking to a professional. Until then, though, just keep trying.