throw a spanner in the works
To introduce a problem, dilemma or obstacle, something unexpected or troublesome.
Halfway through the production of Macbeth, the director found that the stage was smaller than he had expected. This really threw a spanner in the works.