Where are you trying to show the pagination? A reminder:
Hugo supports pagination for your homepage, section pages, and taxonomies.
I can’t be sure, but it looks like you want to create it somewhere else. Check out requesting help, and post a repo link. We have to see how your site is configured, and which templates you are editing.