First and last of category breaks when adding taxonomies

Hello, the distinction between taxonomies, sections and categories is not very clear to me.

I have a website for web comics. Each comic has the following taxonomies:

category: comic-name
comic: comic-name

In config.toml:

[taxonomies]
    category = "categories"
    comic = "comics"

And lastly I have this partial:

<nav id="article-nav">
{{ if and (gt .CurrentSection.Pages.Len 1) (ne .CurrentSection .FirstSection) }}
  {{ $firstInSection := index (first 1 .CurrentSection.Pages.ByTitle) 0 }}
  {{ $lastInSection := index (last 1 .CurrentSection.Pages.ByTitle) 0 }}
    <a href="{{ $firstInSection.RelPermalink }}" id="article-nav-newer" class="article-nav-link-wrap">
        <strong class="article-nav-caption">
            << first
        </strong>
    </a>
    <a href="{{ $lastInSection.RelPermalink }}" id="article-nav-older" class="article-nav-link-wrap">
        <strong class="article-nav-caption">
            last >>
        </strong>
    </a>
    {{ end }}
</nav>

Here’s the problem, if I comment out the taxonomies section in the config, then the partial works precisely as intended. Instead if I enable the taxonomies, then it doesn’t show up at all.

This was working fine when I only needed different comics as categories. Now I want to add another type of post to the top of the hierarchy, like so:

illustrations
    category1
    category2
comics
    comic1
    comic2

So how do I fix this?

It seems like just removing an extra taxonomy, for some reason, fixed this. Can’t say I understand it but it’s solved.