I've had to concoct a pseudo-smallcapping command to cope with characters outside the norm (e.g. h-breve) and thus far have had no problems with it, in body text or in headings.
However, just today I've found that its use in memoir headings is very hit and miss. In the following code sequence, for example,
\chapter{Text Editions} % follows \appendix
<snip>
\subsubsection{The interpretation of \lgm{an} as \smn{dingir}}\label{B.3.4.1}
\subsubsection{The interpretation of similar Sumerian elements}\label{B.3.4.4}
\subsection{The name element \lgm{an-na}}\label{B.3.5}
...
the \lgm{} command which uses it (for expansion see MWE below) works fine the first time, but gives an error the second time (depending on other changes, the hyperref error appears or not):
Changing various parts of the file such as removing an alteration of \settocdepth{} or other commands which potentially affect header numbering can cause the error to vanish.
Here's a MWE which illustrates the problem, with two of the types of changes which hide it.
% !TEX TS-program = xelatexmk
\documentclass{memoir}
% Removing the next line avoids the error
\settocdepth{subsection}
\usepackage{libertine}
\usepackage{polyglossia}
\setdefaultlanguage[variant=british]{english}
\setotherlanguage[]{french}
\setotherlanguage[spelling=old]{german}
\usepackage[%
xetex,bookmarks,
colorlinks=true,linkcolor=blue,citecolor=blue,filecolor=black,urlcolor=blue,breaklinks=true,
pdftitle={Karljürgen G. Feuerherm---Abum--waqar and His Circle},
pdfauthor={Karljürgen G. Feuerherm},
unicode
]{hyperref}
\newcommand{\fakesc}[1]{{\addfontfeatures{FakeStretch=1.1092,FakeBold=1.0,Scale=0.71}\MakeUppercase{#1}}}
\newcommand{\lgm}[1]{{\sffamily\fakesc{#1}}}
\newcommand{\smn}[1]{{\sffamily{\addfontfeature{LetterSpace=10.0}#1}}}
\begin{document}
\tableofcontents
\chapter{Text Editions}
% Removing the next group of lines, or changing their level, avoids the error
\section{Preliminary remarks}\label{B.1}
\section{Principles of transliteration and transcription}\label{B.2}
\subsection{Typographic representation of cuneiform signs}\label{B.2.1}
\subsection{Consonantal ‘i’}\label{B.2.2}
\subsection{\smn{sa₁₀} and \smn{šám}}\label{B.2.3}
\subsection{Superscripted sigla}\label{B.2.4}
\subsection{Damage mark-up}\label{B.2.5}
\section{Principles of translation}\label{B.3}
\subsection{General}\label{B.3.1}
\subsection{Names with exclusively Sumerian elements}\label{B.3.2}
\subsection{Names with exclusively Akkadian elements}\label{B.3.3}
\subsection{Names with both Sumerian and Akkadian elements}\label{B.3.4}
\subsubsection{The interpretation of \lgm{an} as \smn{dingir}}\label{B.3.4.1}
\subsubsection{The interpretation of similar Sumerian elements}\label{B.3.4.4}
\subsection{The name element \lgm{an-na}}\label{B.3.5}
\end{document}
I have a very dim recollection of having perhaps experienced something similar a few years ago but I can't put my finger on it. Many thanks for any help.
\renewcommand{\textsc}[1]{\texorpdfstring{xxx}{#1}}, wherexxxis your current definition of the command. – Michael Palmer Oct 24 '17 at 18:04\textsc{}elsewhere. – K.G. Feuerherm Oct 24 '17 at 19:58\MakeUppercase. But some way to patch the code would definitely be preferable. – K.G. Feuerherm Oct 24 '17 at 20:00\texorpdfstringfix with\fakesc. It seems all the error messages arise in a pdf-string context. – Michael Palmer Oct 24 '17 at 20:02