In essence the problem that the OP identified is not that the FX market itself has poor liquidity but that retail FX brokerage sometimes have poor counterparty risk management. The problem is the actual business model that many FX brokerages have. Most FX brokerages are themselves customers of much larger money center banks that are very well capitalized and provide ample liquidity.
By liquidity I mean the ability to put on a position of relatively decent size (long EURUSD say) at any particular time with a small price impact relative to where it is trading.
For spot FX, intraday bid/ask spreads are extremely small, on the order of fractions of pips for majors (EUR/USD/GBP/JPY/CHF). Even in extremely volatile situations it rarely becomes much larger than a few pips for positions of 1 to 10 Million USD equivalent notional value in the institutional market. Given that retail traders rarely trade that large a position, the FX spot market is essentially very liquid in that respect.
The problem is that there are retail brokerages whose business model is to encourage excessive trading in the hopes of capturing that spread, but not guaranteeing that it has enough capital to always meet all client obligations.
What does get retail traders in trouble is that most are unaware that they are not actually trading on an exchange like with stocks. Every bid and ask they see on the screen the moment they execute a trade is done against that FX brokerage, and not some other trader in a transparent central limit order book.
This has some deep implications. One is the nifty attribute that you rarely pay "commission" to do FX trades unlike in stock trading. Why? Because they build that cost into the quotes they give you. In sleepy markets, buyers and sellers cancel out, they just "capture" that spread which is the desired outcome when that business model functions well.
There are two situations where the brokerage's might lose money and capital becomes very important.
In extremely volatile markets, every one of their clients may want to sell for some reason, this forces the FX brokers to accumulate a large position in the opposite side that they have to offload. They will trade in the institutional market with other brokerages to net out their positions so that they are as close to flat as possible. In the process, since bid/ask spreads in the institutional market is tighter than within their own brokerage by design, they should still make money while not taking much risk. However, if they are not fast enough, or if they do not have enough capital, the brokerage's position might move against them too quickly which may cause them lose all their capital and go belly up.
The brokerage is net flat, but there are huge offsetting positions amongst its clients. In the example of the Swiss Franc revaluation in early 2015, a sudden pop of 10-20% would have effectively meant that money in client accounts that were on the wrong side of the trade could not cover those on the other side. When this happens, it is theoretically the brokerage's job to close out these positions before it wipes out the value of the client accounts, however it would have been impossible to do so since there were no prices in between the instantaneous pop in which the brokerage could have terminated their client's losing positions, and offload the risk in the institutional market. Since it's extremely hard to ask for more money than exist in the client accounts, those with strong capital positions simply ate the loss (such as Oanda), those that fared worse went belly up.
The irony here is that the more leverage the brokerage gave to their clients, the less money would have been available to cover losses in such an event.
Using an example to illustrate: say client A is long 1 contract at $100 and client B is short 1 contract at $100. The brokerage is thus net flat. If the brokerage had given 10:1 leverage, then there would be $10 in each client's account.
Now instantaneously market moves down $10.
Client A loses $10 and client B is up $10. Brokerage simply closes client A's position, gives $10 to client B. The brokerage is still long against client B however, so now it has to go into the institutional market to be short 1 contract at $90. The brokerage again is net flat, and no money actually goes in or out of the firm.
Had the brokerage given 50:1 leverage however, client A only has $2 in the account. This would cause the brokerage close client A's position. The brokerage is still long against client B, but has only $2 and would have to "eat the loss" for $8 to honor client B's position, and if it could not do that, then it technically became insolvent since it owes more money to its clients than it has in assets.
This is exactly the reason there have been regulations in the US to limit the amount of leverage FX brokerages are allowed to offer to clients, to assure the brokerage has enough capital to pay what is owed to clients.