So what is to stop someone from depositing the near expiration date money into a bank and then withdrawing it right away?
Most of the time, people with large amounts of cash are workers (skilled construction workers...) that are able to get a significant part of their income in cash and do income tax avoidance. Or criminals (drug dealers...).
Having to deposit their hidden savings all-at-once is not good news for them. This is basically what happened when France switched to the Euro.
If they have to explain where the money came from, they can just say “it is the cash I withdrew a few months ago, here is the transaction number”