To pull the rug out from under someone is to upset their stability or to cause their plans to fail. To understand this idiom, just imagine what would happen if you suddenly jerked a rug out from under someone standing on it. Pull the rug out from under, which dates from the early 20th century and is likely American in origin, treats this action metaphorically.
Examples
The president had pulled the rug out from under our ally, forgoing any U.S. policy on any issue the Palestinians would have to compromise on. [Washington Post]
Rather than showing support and understanding for the situation, the NHL pulled the rug out from under the fans. [Ottawa Citizen]
Such a move would pull the rug out from under Greek banks, which had nearly 90 billion euros in ECB funding at the end of March. [Sydney Morning Herald]
Pulling the rug out from the ZEV program – the only stick with the carrots – threatens to undermine these investments. [National Resources Defense Council]