Ordering custom post type by custom field without a title

As far as I know, you can’t actually publish a post without a title. WP might erroneously say your posts are published, but I’m pretty sure they’re still viewed as drafts, which is why you don’t get any post results.

First, make sure your custom post type supports your custom field:

$args = array(
    'post_type' => 'people',
    'posts_per_page' => 40,
    'meta_key' => 'surname',
    'orderby' => 'meta_value',
    'order' => 'ASC',
    'paged' => $paged,
    'supports' => array( 'title', 'editor', 'custom-fields')
);

Then, you could auto populate the title or create it from meta data:

Set post title from two meta fields