Problem creating a custom category page with pagination

On request, a custom template does not mean custom query :-).

As already mentioned, NEVER use query_posts, it breaks the main query object and page functionality, one of which is pagination. Many plugins and functions relies on the main query object, you break that, you break those functions as well.

As this is a custom category template, it is also not necessary to run a custom query at all to get the thinks done that you want done. The main query can be safely altered with pre_get_posts for a specified template before the main query executes in order to get your desired result.

You can do the following in your functions.php, this will give you 2 posts per page on your custom category template and it will correctly handle your pagination issue 😉

add_action( 'pre_get_posts', function ( $q )
{
    if (    !is_admin() // Only targets front end
         && $q->is_main_query() // Targets only the main query
         && $q->is_category( 'SPECIAL CATEGORY' ) // Only targets your custom category page, change accordingly
    ) {
        $q->set( 'posts_per_page', 2 ); // Sets 2 posts per page on special category page
    }
});