They don't have a single or just a few ventures so they get out of money if they lose money in some of their ventures, they don't lose money in the first place because they don't make investments or accept commodities and stuff that they know are not going to get them any profit in the first place, and even if they do it sometimes, they have a lot of ventures going on at one time and they earn more money than they might lose in some of those ventures.
So, this isn't more than an excuse if they say that they don't have any reserves left because they have lost money in their investment ventures because a bank can never get out of money because of their business structure which allows them to always have money in their reserves and they are supposed to have reserves for every single penny they have of their customers.
Banks may claim to have no cash, but that doesn't mean they don't have penny. They have it, infact enough in their account but what it means some time is that, they can not afford to give you this amount you are requesting for now.
Also some time they use such statement to refer to a situation where they can afford to give you the amount but due to some policy place on currency, they may try to just save their time by using this simple statement to their customers.
usually when someone need to withdraw huge amount of money they need to notice the bank before hand to ready the money before they can cash it out, it confirms your statement that bank usually just give back the money other people deposited for their liquidity so it does make sense that there's sometime no money in bank.
usually the bank themselves try to profit off the money deposited by investing it else where or give loan to people after all bank with their large scale of operation requires a lot of money if they don't do that i doubt there gonna be any bank office in every city.
there's reason why there exist term called Rush Money where people taking their money off banks due to mistrust and that usually causes bank to collapse.
Some times, banks 🏦 also utter such statement to customers when there are a lot of cashes outside the bank which they are trying to retrieve into the bank. when this kind of things happens, it makes the apex bank to place restrictions on the amount of cash to be withdrawn by customers. For example, Nigeria now is currently under going this kind of thing. Cash policy order is been given by the federal government that no customer should withdraw more than five hundred thousand naira in a week. So when things like this happen, it makes banks to claim no cash in the bank. but in reality, there is.