Retrieve or Query Pages by ID

This is an inappropriate use of query_posts() which is only for modifying the main query for the page. Additionally, even if you change your snippet to use get_posts(), your template tags (e.g. the_excerpt()) won’t work as get_posts() isn’t a method of looping through posts, it just returns an array of posts.

What you want is WP_Query. Change your first lines of code to this:

$args = array(
    'post_type' => 'page',
    'post__in' => array(3,5,7)
);
$my_three_posts = new WP_Query( $args );
while ($my_three_posts -> have_posts()) : $my_three_posts -> the_post();
...