Using the following mwe:
% vim: spell spelllang=en ft=tex
\documentclass[12pt,twoside,openright,english]{book}
\usepackage{hyperref}
\usepackage{lipsum}
\usepackage[explicit]{titlesec}
\usepackage{titletoc}
\renewcommand{\thechapter}{\Roman{chapter}}
\newcommand\periodafter[1]{#1.}
\titleformat{\chapter}[display]
{\normalfont\large\filcenter}{\filcenter\MakeUppercase{\chaptertitlename\ \periodafter{\thechapter}}}{0pt}{\periodafter{\uppercase{#1}}}
\titleformat{\subsection}
{\normalfont\small}{}{0em}{\hangindent=0.25in#1}
\titlecontents{chapter}
[0em]
{\filcenter\normalfont\scshape}
{\MakeUppercase{\chaptertitlename\ \thecontentslabel}\\addvspace{5pt}\uppercase}
{\MakeUppercase{\thecontentslabel}\\addvspace{5pt}\uppercase}
{}[\addvspace{5pt}]
\titlecontents{section}
[0em]
{\hangindent=0.25in\small}
{\contentslabel{0em}}
{\contentslabel{0em}}
{\titlerule*[1em]{.}\contentspage}[\addvspace{5pt}]
\titlecontents{subsection}
[0em]
{\hangindent=0.25in\small}
{}
{}
{\titlerule*[1em]{.}\contentspage}[\addvspace{5pt}]
\setcounter{secnumdepth}{0}
\hypersetup{
bookmarksdepth=1
}
\begin{document}
\tableofcontents
\frontmatter
\chapter{Foreword}
\mainmatter
\chapter{A}
\subsection{\lipsum[1]}
\chapter{B}
\subsection{\lipsum[1]}
\backmatter
\chapter{C}
\subsection{1}
\lipsum[10]
\newpage
\subsection{2}
\lipsum[10]
\end{document}
Section C.1 and C.2 show, in the toc, the proper page numbers (5 and 6 respectively) However, clicking the red boxed number of either both bring you to page 5.
This question's answers and comments suggests it to be an issue regarding versions and says its fixed in titletoc 2.11; however my (freshly updated and upgraded as I write this) texlive installation (using lualatex 1.17.0 (TeX Live 2023)) has versions v2.14 of titletoc/titlesec, and v7.00y of hyperref.
Using the MWE from the accepted answer as is seems to produce the same issue.
\titleformat{\subsection}{\normalfont\small}{}{0em}{\hangindent=0.25in\MakeLinkTarget[subsection]{}#1}. Unreleted but you have duplicated page numbers. Ensure that every page has an unique name. – Ulrike Fischer Jun 10 '23 at 12:48\[front|main|back]matter; in my 'real' projects, I initially set the numbering to alphabetic (to cover a titlepage/similar before anything is 'visibly' numbered), and frontmatter switches to roman, and mainmatter switches to arabic. – hanetzer Jun 10 '23 at 16:21