A simpler solution with idiomatic Spock: https://spockframework.org/spock/docs/2.3/all_in_one.html#_chaining_method_responses
serviceUnderTest.foo(serviceID1) >> "fine"
serviceUnderTest.foo(serviceID2) >> { throw new Exception() }
or you can even do this:
serviceUnderTest.foo(_) >> "fine" >> { throw new Exception() }