Changing a Profile type Machine Name broke the Admin/People search I'm working on a Drupal 7 website in which there are several Profile types. 
As part of a task, I had to change the "Label Name" and the "Machine Name" of one of them: specifically Professional Courses was changed in Professional School. 

Later on, I've realised that this substitution have broken the search in the Admin/People page. Precisely, if the Administrator, from the Admin/People page, searches the users with the Profile type just mentioned, the search shows no results.  
I've discovered that the View managing this page (Admin/People), has kept the old Machine Name in the query, which means that role has been cut out.

I’ve tried to fix this error by changing the query using the following code inside a views_pre_execute function in a custom module I've developed:

$query = db_select('users', NULL);
$query-&gt;condition('users.uid', array('0'), 'NOT IN');
$query-&gt;fields('users', array('uid', 'name', 'mail', 'status', 'created', 'access'));
$query-&gt;addJoin('INNER', 'profile', NULL, 'users.uid = profile.uid AND (profile.type IN ( \'master_school\', \'employee\', \'summer_school\', \'professional_courses\', \'digital_friend\', \'phd_school\', \'professional_school\' ))');
$query-&gt;orderBy('users.access', 'DESC');
$query-&gt;range(0, 100);

$view-&gt;build_info['query'] = $query;


However, this code changes the query inside the View, but didn’t fix the problem. 
How can I fix this bug? Should I go back to the old Machine Name?
Thanks!

P.S. I'm using Profile2 and Administration Views modules.
I think this is a bug in Profile2 module.
I recreated your issue on a test installation and the same results happened. 
After I inspected the database itself I found that the machine name was not changed in the table profile but correctly changed in profile_type table.
What you could try is to manually change the machine name in the profile table and see what happens then.
Also, it might be helpful to post your issue in Profile2 issue tracker, maybe they can fix this for other users.

Good luck.