What happens when a reserve bank runs out of foreign currency reserve? What happens to a country when a reserve bank runs out of foreign currency reserve?
This is an excellent question and it deserves a good answer and I will try my best here.

So what is a reserve currency? A reserve currency is a currency that other nations use for making global payments, loans and foreign exchange reserves.

The four currencies that are considered global are the US dollar (USD), the Euro, the Japanese Yen and China's RMB (yuan).

Now, what happens to a bank when it runs out of reserve currency, well, it depends who the bank is, where its located and what the reserve currency is that they have run out of.

If you are one of the four currency nations then you are exporting your currency, but you have to export enough into the global system to support the demand for payments, loans and reserves. 

Central banks in general could also issue lines of credit which require payment in one of the four reserve currencies mentioned above.

This becomes part of someone's job at these banks to ensure that there is a harmonious balance on the balance sheet at all times between exporting currency, issuing credit and demanding payments.

Lets take a case study such as the EU banks where they had issued loans in Euros, and the fatal consequence of that started to become clear in 2016. Emerging market borrowers were forced to default as their currencies weaken against the Euro and the USD, driving the costs of servicing their debt denominated in Euros and USD higher.

Someone mentioned Venezuela above and yes this is what happened to them. Not that they ran out of foreign currency, but that the cost of servicing their debt denominated in USD and Euros soared to the extent that it weakened their own currency, in addition to their policy of expropriating businesses that did not belong to the government and other policies which finally lead to foreign investment high tailing it out of there and a vote of no-confidence for the now dead Bolivar.

Even nations have credit reports and credit ratings and you can imagine when they run into that kind of trouble, their ratings drop.

In my opinion, the system of reserve currencies is dysfunctional for everyone, creating and incentivizing fatal imbalances in trade, yields and debt. Some look to a basket of currencies from the World Bank known as Special Drawing Rights or SDRs as the solution, but all this does is tighten the coherence of a system that's already dangerously hyper-coherent, that is, highly susceptible to contagion.

But the concept of reserve currency and the balancing act that banks have to go through with it is not perfect and even gold had its limitations. Anyway, I hope this is some semblance of an answer or gets you closer to your answer.