The mistaken name becomes smaller after a direct correction lets conversation continue.
GRATITUDE
GRATITUDE
Getting a name wrong is a small event that grows in the silence after it. The person corrected once, plainly, and then carrying on is the shortest route through; the long apology, the explanation of why it happened, the joke about being bad with names all make the moment bigger than it was. Correction is information rather than accusation. Treated that way it takes three seconds and disappears.
If someone gets your name wrong, say the right one once and keep talking. If you are the one who erred, use the correct name in your next sentence and let that be the whole of the repair.
Whose mistake about your name have you never bothered correcting?
Free, with nothing to buy inside it.