That could happen, but you still get a chance to buy the house of your dreams.
If the buyer of your home signs up subject to conditions, those conditions will have a time frame that they need to be settled by (in working days).
You will also have a timeframe to go unconditional on the house you are buying if the vendor receives another offer (usually 5 working days).
You would be pretty unluck for those two timeframes to not overlap.
Situation - You find a buyer, they make an offer subject to LIM and finance, they have 5 working days to satisfy those conditions and go unconditional.
The same day, the vendor of the house you want to buy gets a cash offer they are happy to take.
Their agent informs you/your solicitor that they are invoking the cash-out clause. You now have 5 working days (or whatever is in the contract) to go unconditional - during these 5 days, they cannot sell the house out from under you.
If/when the buyer of your house is satisfied and goes unconditional, you inform your solicitor that you're ready to go unconditional, they inform the vendor's solicitor, and you've bought a house.
Of course, the buyer of your house may request more time in their offer to satisfy conditions. If that happens (say, they want 10 working days, and you agree, and the cash out happens within the first 5 working days and you've only got a 5 working day cash out clause), then you lose the house unless you take a big risk and go unconditional and hope like hell your buyer doesn't walk away.