The value in your code is set here $value = $page->post_name;
so this is dependent on what WP is returning as thepost_name. Try $value = strtolower($page->post_name);
I have no idea why it’s returning a capitalized value unless that what’s in the DB.