according to a german report ATMs can scan the serial numbers when the money is dispensed, logging them to the account from which the money is withdrawn. it's generally not done now, but it is technically possible. in china it apparently is already enforced. elsewhere at a minimum they track which notes are sent to which ATM in order to resolve ATM robberies. likewise when money is deposited, it is being scanned for fakes. counting and sorting machines can track the serial number too:
https://netzpolitik.org/2025/bargeld-tracking-du-hast-ueberw...
https://www.citechsensors.com/en/technology.html