I've noticed maybe 5% of the time, walletnotify setting within bitcoin.conf will fire off duplicate messages, or at least dupes that my software can't pick up.
Have you checked it's really a duplicate?
walletnotify send notification up to two times (transaction on mempool and receive 1 confirmation) for each transaction, so it's possible the transaction added to your mempool just before your node receive block containing that transaction. But if it's really duplicate, it's a bug and you might want to report it to
https://github.com/bitcoin/bitcoin/issues.