Filtering and paginate collection with cta in between

I have this collection of blogposts that I can filter by tag. I want the page to only display the 12 most recent posts (and when filtered the 12 most recent with that active filter of course). This is working fine, however I want to be able to put a CTA after 6 posts and show the other 6 posts after that. I tried doing this with the code below but this way the pagination is not working properly. Page 1 shows as:

  • Cards 1-6
  • CTA
  • Cards 7-12

Page 2 shows as:

  • Cards 7-12
  • CTA
  • Cards 13-18

What would be the best approach for this to work?

Insights controller

<?php

return function ($kirby, $site, $pages, $page) {
    $filterBy = get('filter');
    
    $unfiltered = $page->children()->listed();
    
    if ($filterBy) {
        $filtered = $unfiltered->filterBy('tag', $filterBy, ',');
    } else {
        $filtered = $unfiltered;
    }
    
    $tags = $unfiltered->pluck('tag', ',', true);
    
    return [
        'filterBy' => $filterBy,
        'unfiltered' => $unfiltered,
        'filtered' => $filtered,
        'tags' => $tags
    ];
};

Insights page template

<!-- Filter -->
<?php snippet('sections/insights/filter', ['tags' => $tags, 'filterBy' => $filterBy]) ?>

<!-- Collection part 1 -->
<?php snippet('sections/insights/cards', ['tags' => $tags, 'filterBy' => $filterBy, 'collection' => $filtered->paginate(6)]) ?>

<!-- CTA -->
<?php snippet('sections/cta') ?>

<!-- Collection part 2 -->
<?php snippet('sections/insights/cards', ['tags' => $tags, 'filterBy' => $filterBy, 'collection' => $filtered->offset(6)->paginate(6)]) ?>

<!-- Pagination -->
<?php snippet('sections/insights/pagination') ?>

Not super familiar with pagination, but would it work if you paginate by 12 (since you want 12 items per page), then slice the resulting paginated collection?

Something like:

<?php

$items = $filtered->paginate(12);
$start_items = $items->slice(0, 3);
$end_items = $items->slice(3, 3);

// Collection part 1
echo snippet('sections/insights/cards', ['collection' => $start_items]);

// CTA
echo snippet('sections/cta');

// Collection part 2
echo snippet('sections/insights/cards', ['collection' => $end_items]);

?>

Not really 100% sure I understand, but what I would do:

<?php

return function ($kirby, $site, $pages, $page) {
    $filterBy = get('filter');
    
    $unfiltered = $page->children()->listed();
    
    if ($filterBy) {
        $filtered = $unfiltered->filterBy('tag', $filterBy, ',');
    } else {
        $filtered = $unfiltered;
    }
    
    $tags = $unfiltered->pluck('tag', ',', true);
    $filtered = $filtered->limit(12)->paginate(6);
   $pagination = $filtered->pagination();
    return [
        'filterBy' => $filterBy,
        'unfiltered' => $unfiltered,
        'filtered' => $filtered,
        'tags' => $tags,
        'pagination' => $pagination,
    ];
};