EntityFieldQuery in rules - no result
array_keys($result['node']) isn't going to return an object that you can select a nid property from; it's going to return an array of nids that have $termid tagged in its field_terms field. If you're just looking for the first nid in the query results you can do $nid = array_keys($result['node'])[0];