This is most likely because your structure doesn’t match the received JSON schema. In this case, the extractHits function throws a DecodingError.
The Swift API client provides a prettyDescription extension method for DecodingError. You can use it to print the error in your console and get more details.