Query returning same results even though the ID changes

You can pass your meta query into query_posts or (the preferable) WP_Query in 2 ways:

  1. An array using the array keys meta_key, meta_value, meta_type and meta_compare
  2. An array of arrays using the array keys key, value, type and compare

In your question, you were trying to use a mix of the two, and that’s why it wasn’t working.

1. An array using the array keys meta_key, meta_value, meta_type and meta_compare

This is the way you were trying to do it in your question, but the meta_query should have been using the following array keys:

$args = array( 
      'post_type' => 'topics', 
      'post_status' => 'publish', 
      'posts_per_page' => -1, 
      'meta_query' => array(
             'meta_key' => 'forum_category', 
             'meta_value' => $forum_id, 
             'meta_compare'   => '=' 
             ) 
      ) 
 );

2. An array of arrays using the array keys key, value, type and compare

From the Codex for WP_Query:

Important Note: meta_query takes an array of meta query arguments arrays (it takes an array of arrays) – you can see this in the examples below. This construct allows you to query multiple metadatas by using the relation parameter in the first (outer) array to describe the boolean relationship between the meta queries.

$args = array( 
      'post_type' => 'topics', 
      'post_status' => 'publish', 
      'posts_per_page' => -1, 
      'meta_query' => array(
          array(
             'key' => 'forum_category', 
             'value' => $forum_id, 
             'compare'   => '=' 
             ) 
          )
      ) 
 );

The advantage of using this way is that you can add multiple meta_queries to refine the results, for example you could get all posts where both forum_category = $forum_id AND forum_moderator = $moderator_name

$args = array( 
      'post_type' => 'topics', 
      'post_status' => 'publish', 
      'posts_per_page' => -1, 
      'meta_query' => array(
          'relation' => 'AND',  // this could also be "OR"
          array(
             'key' => 'forum_category', 
             'value' => $forum_id, 
             'compare'   => '=' 
             ),
          array(
            'key'     => 'forum_moderator',
            'value'   => $moderator_name,
            'compare' => '='
        ),
          )
      ) 
 );

Ref: See the Codex for WP_Query for more information and examples.

Note: I realise you found an answer, but I thought the additional information and alternative usage might be helpful – even if not to you, then to other users searching with a similar problem.