If a bank happens to be robbed just after I withdraw money from my account, and the robbers make me hand over my money to them, am I entitled to refund from the bank? I know it may depend on the country, but you can tailor your answer to how it applies in a country you have knowledge about.
Not in any jurisdiction of which I am aware.
The whole point of currency is that it is completely negotiable. Once it is in your hands, its prior history is completely irrelevant.
The vulnerability to theft is one reason that large transactions are rarely conducted in cash, and are instead conducted either via wire transfer or via a check or money order (giro in Europe) of some sort payable to a particular person.
If the bank was somehow negligent in a manner that you could prove, and you could prove that this caused your harm, you might be able to sue the bank on a negligence theory, but generally a robbery would be an intervening cause of your loss that would absolve the bank of ordinary negligence.
A better fact pattern for negligence claim would be something like this: the bank where you had a safe deposit box left the safe door open and the keys to your box in an easily to see cork board by its door, meanwhile the employees of the bank all left on their lunch break at the same time and forgot to lock the bank's front door when they left, and as a result, someone stole something out of your safe deposit box.
Usually, the bank would cooperate in helping you to prove your loss with a withdrawal slip and other corroborating evidence, which would allow you to take a casualty loss deduction and/or make a claim for theft against your own insurance policy (which will often cover a very modest amount of theft of cash). But, ordinarily that would be it (maybe they'd buy you a coffee and donut to sooth your nerves while waiting around to give a police report).
Not in Australia.
First the bank does not owe you a duty of care (probably) and even if they did, the actions of the robber are not actions of the bank.
See here for an example - the claim was for PTSD but the principle would be the same for monetary loss.