A forgotten name can be rescued without making the person perform their discomfort.
GRATITUDE
GRATITUDE
Forgetting a name is ordinary and the awkwardness around it is entirely optional. The usual repair makes it worse: a long apology, a joke about your memory, a request that the person state their own name in front of others. Now they are managing your embarrassment as well as their own. The quiet version costs nobody anything.
Give your own name first and most people will offer theirs back without noticing why. Or ask a nearby colleague quietly, or check the invitation. If you do have to ask directly, keep it to one short sentence and move straight on.
What do you do when a name escapes you publicly?
Free, with nothing to buy inside it.