I think I figured this out.
If that setting (enable contains searches) is changed after the fact, you need to run a reindex of all of the data, because it introduces a change in the way that string indexes are written.
You can do this by issuing the following SQL query (assuming Postgres):
insert into hfj_res_reindex_job (pid, update_threshold_high, job_deleted) values (1, now(), false);
You can also go this by invoking the "$mark-all-resources-for-reindexing" operation (assuming security/permissions are sufficient, and this operation is enabled).
I'm trying this on the public HAPI FHIR server and I'm now getting a different error (siiiigh) relating to terminology reindexing. Just looking into this now. If you aren't using terminology services in the HSPC sandbox that's probably not an issue for you.
Cheers,
James