Query_posts works when appending via AJAX call wp_query doesn’t?

Calling the_post() operates on the global $wp_query, for your custom query you need to call the method of the query object: $loop->the_post().