Payment has already been made for this InvoiceID (#10412: Duplicate invoice) Magento Error.

When Order placed using PayPal payment, Customers facing an error for a #10412 duplicate invoice:

PayPal gateway has rejected request. Payment has already been made for this InvoiceID (#10412: Duplicate invoice).

You can Resolve the error by Paypal Account settings steps.

1. First login to Paypal site

2. Click on Upper right side circle settings icon,  Choose Account setting from the dropdown

Paypal account setting
Paypal account settings

3. Find Payment Preference from the left sidebar and click on it.

update
Payment Preference

4. Click on Update link from the Block payments section.

5. Find Block accidental payments section,

Block accidental payments
Block accidental payments

Checked No, allow multiple payments per invoice ID radio option. It’s Auto Saved.

Clear Cache on Magento by command,
php bin/magento cache:flush

Just Add Product to the cart, Go to the Checkout page, try to place an order using Paypal Method, Your order placed successfully without duplicate invoice error.