wp_query not working with post_type

First I would state that in most cases the query_posts should be avoided!

This function will completely override the main query and isn’t
intended for use by plugins or themes. Its overly-simplistic approach
to modifying the main query can be problematic and should be avoided
wherever possible.

I would suggest transfer your query with WP_Query and try something like this:

$all_prods = array(
    'posts_per_page' => -1,
    'post_type'      => 'product',
);
$query = new WP_Query($all_prods);

while ($query->have_posts()) {
    $query->the_post();
    $post_id = get_the_ID();
    echo $post_id;
}

For the Debug part, I would use the get_post($post_id); to verify that we talk about the same post_type.

error code: 523