Rewrite rule not working, issue may be in URI request

I think you should do something like this:

function my_rewrite_rule() {
   add_rewrite_rule('^prefix/section/([0-9]+)/([^/]*)?', 'index.php?section=$matches[1]&name=$matches[2]&post_type=post', 'top');
}
add_action('init', 'my_rewrite_rule');

Add a query var for section:

function my_query_vars( $vars ) {
   $vars[] = 'section';
   return $vars;
}
add_action( 'query_vars', 'my_query_vars' );

I created the pattern for your section (which can be 1 or 2) and used $matches[2] to set the “name” parameter, which is your slug. Then I set the “post_type” to “post” to be sure WordPress is searching for a post.

Because I added the query var you can then do:

$section = get_query_var( 'section' ); 

To know which section is loaded.