If someone throws a spanner in the works, they prevent something happening smoothly in the way that it was planned, by causing a problem or difficulty.
[British] A bad result is sure to throw a spanner in the works.
regional note: in AM, use throw a wrench, throw a monkey wrench