Queer the Pitch

What does the idiom “Queer the Pitch” mean?

Definition:

Interfere with someone’s plans; make something more difficult

For example:

“Although he supports the prime minister’s party, he’s trying to queer the pitch for that party’s candidates.”