While using redhen module along with search api and solr search modules, I ran into an issue where the solr search would work for the defined contact index but not for organization index, both contacts and orgs being sub modules of redhen. Any attempt to query the org index would throw:

EntityMetadataWrapperException: Invalid data value given. Be sure it matches the required data type and format. in EntityDrupalWrapper->set()

After much debugging, I was able to fix the issue by ensuring that the $data value inside EntityDrupalWrapper construct was always an object contrary to what the param description specified, that it could be on object or an identifier. I added the following code inside the EntityDrupalWrapper construct at line 591:

    if( isset($data) && !is_object($data) ){
      $data = entity_load_single($type, $data);
    }

Of course, I could have added this fix in the other modules but I just saw it fit to include it in there since the behaviour wasn't as described in the comments.