Custom post type pagination error

I think next_posts_link() is using the global $wp_query to determine pagination, but you’ve created a new query here. Try passing max_num_pages from your $loop query to it:

next_posts_link( '<span class="nextpost">Next</span>', $loop->max_num_pages );

tech