"Card nonce already used with a different idempotency key; please request new nonce"

For years I’ve used Gravity Forms with Square payments plugin to collect ticket ordering information. One customer reported this error in a screenshot. When submitting the order, it appeared as a form validation error:

“Credit Card Payment: Card nonce already used with a different idempotency key; please request new nonce”

What does this mean and what can I do about it? I’m not sure if this resulted in a transaction because the customer gave me only a screenshot without much context.

I’ve been able to track that this validation error coincides with the user’s card actually getting charged. This has led to several complaints of duplicate charges because the user sees the cryptic error and then tries again. And on the second time it seems to consistently work where it charges the card and confirmations successful payment. I then have to refund the first charge when this happens.