In 2013, the average checking account balance was US \$9,132. That's personal accounts, not business or government accounts. But for people with an income above US \$160,000 / year, the average balance was over US \$700,000. Again, personal, not business. For those with incomes below US \$45,000, the bank balance was below \$3,600.
Given that many large business accounts will have significantly higher balances than the average citizen, and that the wealth distribution is heavily weighted, I suspect the lowest income people will see a rise in bank balance, while those at the highest income levels will see a drop. Those in the middle of that bell curve will have the most randomness to their balances.
But really, the new balances don't matter, as we'll explore below. What matters is the introduction of chaos...
Immediate term
You are going to have serious problems. Day 1, CNN, Fox News, BBC, and all other news outlets flood the airwaves and papers with news that all the bank accounts got mixed around in a big melting pot.
So everyone lines up at the bank. Or logs into the bank. The bank's websites crash, as they're now effectively suffering a DDoS attack as users flood their sites. The lines will be long. The bank support phone numbers will be jammed. Panic.
This will continue for a time. In the USA, the federal government will probably institute an emergency bank holiday. Not sure how long that would last, but during this holiday, the banks would be doing their best to restore from backups, find audit traces, etc. The bank computer systems have pretty thorough audit logs. Banks would spend days, possibly weeks, trying to reconstruct accounts. The OP says these measures will fail, but they would try. Other nations' banks would go through similar steps.
The FBI, NSA, CIA, and similar groups in other countries would go on extremely high alert. I suspect the military would go on high alert as well, at least until it could be proven that this wasn't an act of cyberwar.
Hopefully, governments and businesses would find some sort of interim solution for commerce, because otherwise, people will die. Pharmaceutical companies, food and agriculture, these are critical international markets that if they stop, people don't survive. Remember, most industrialized nations cannot grow enough food to feed their people reliably, year round. So many import food from around the world. Especially produce. That's how we get out-of-season crops.
Then there are cities. It took 200,000 flights to provide Berlin with food and supplies for a year during the Berlin Blockade. Now imagine every city in the world facing the need to feed and supply their citizens when no one can pay for the shipment of any goods. No one can pay for trucking or trains. No cargo ships full of Argentina apples. No meat from out west delivered to your local butcher. Everyone goes hungry. No insulin for your diabetics; who's paying for that? Everyone gets sick or sicker.
If food and medicine deliveries aren't secured, then the riots tear apart every city in the world. And if that happens, no nation will survive. So that's a crisis that governments and industry must solve immediately or die. The rest of this post assumes they hobble together something. Anything else results in anarchy.
Short term
After the banks close, people will panic. News cycles would probably be fueling the panic. Comparisons to the bank collapses around the Great Depression would be constant.
No one can issue paychecks. No one can pay their bills. No one can do anything if they don't have cash on hand. By day 2 or 3 at the latest, the stock markets would be shut down, since businesses no longer have reliable checking accounts either. The markets would have to be shut down to prevent a complete collapse as everyone tries to sell and cash out.
Without paychecks and other cash transactions, trade halts. Government would need to do something to maintain food availability, since most people don't keep enough cash to buy groceries and few people maintain sufficient food supplies to go more than a week or two.
Emergency measures would be taken to prevent riots. There would be riot-gear equipped police in all major cities and many smaller cities/towns.
Everyone would be asking questions. Who, why, how. Within a week, it would be clear that banks cannot fix this. It is a complete, hard, reset on the entire economy.
Medium term
By this time, it would be clear that while some accounts in some cases could be rebuilt from paper records, the system as a whole couldn't be rebuilt. And once people said, "Well, I've got my bank statements going back 10 years, give me my money!" everyone else would demand their money, too. And at least some percentage of people would think they were clever enough to game the system. "I've got a good printer and enough computer savvy to fake my bank statements..." so now the banks can't really trust the statements to be accurate either. That lack of reliable paper combined with the significant percentage of people without paper records, means banks as a whole cannot trust any of the papers anywhere.
Remember, this isn't just your grandmother's savings account or your checking account. This is also the account your employer writes paychecks from. This is where your rent checks deposit to. This is where your grocery store pays it's bills from.
By now, all of the initial panics are done. Banks will still be closed, at least until government figures out what to do. Barter is more popular than ever in living memory. The riots will have been quashed, one way or another. More cities across the world look like the burned out parts of post-riots Detroit than ever since the end of WW2.
The entire world economy has ground to a halt at this stage. No one has the means to pay for anything. Suddenly the Amish, with cash in hand and plenty of garden space, look far wiser than they have in the last 200 years. Doomsday preppers have been laughing this whole time, while they choke down freeze-dried food that's edible but tastes bad.
Congress will be under extreme pressure to "do something". And maybe they will. They must. Though at least in the USA, partisanship politics will make this a difficult time for them as well. At a global level, the UN will be frantically trying to prevent war and economic collapse, too.
If the UN cannot maintain peace between panicked member states, or if any one (or more) nation decides that the other nations somehow are responsible for this mess, then war will break out. Hopefully, these will be relatively small-scale actions in smaller nations. Hopefully, the warfare won't spread up to the 2nd and 1st world nations. But that's not guaranteed. Wars generally occur for three reasons: "the gods demand it", "we need money/resources/things", and "if THEY are the enemy then you won't get mad at how horrible a leader I am". This event triggers the second quite easily and quite suddenly.
Government would have to write laws, too, that prevented civil lawsuits. Otherwise, the courts would be overrun with lawsuits and class-action lawsuits. If those cases were permitted, lawyers would be lining up. Any bank that wasn't already ruined beyond repair would be destroyed.
Long term
Long term, the major goal is to reduce this great depression and prevent global war. A broken nation with no economy and no hopes will often fall into warfare. It's happened before (see also Nazi Germany, which "solved" their unemployment crisis through military spending). Given the scope of this disaster, it would likely happen here. WW3 isn't impossible. It's likely.
Some governments will have nationalized their banks to take control and restore order. Perhaps they socialize the wealth and redistribute it. Perhaps they start over with some other measure. There's no way to predict how each nation will solve this crisis.
But once they do solve it, we will see some kind of major sea-change to how accounting is done. No one will ever trust banks to maintain account histories and balances ever again. This new system will be the most radical rewrite to bookkeeping / accounting since the invention of double-entry bookkeeping.