ToC referencing to itself?

Hi!

A bit of a newbie question,

When I do the ToC with special copy paste thing and then try to compile the text in PDF the ToC oddly seems to referencing to itself ? So when compiling to PDF rather than replacing <$p> with the actual chapter/content page number it uses ToC’s own page number given by compiler footer setting in this case? So the questions are:

  1. If this is the case how do I exclude it from page numbering, especially if I don’t want to change ToC to page one?

  2. Are there any other tools to manage header/footer content than the lines in compiler settings?

  3. Is it a compiler settings issue?

  4. Feel free to comment how do you feel about ToC and page numbering working in general. I have an option of doing it in Affinity Publisher as well.

Here’s image for reference.

Appreciate the feedback.

Br,

Timo