Please see this MWE.
\documentclass{memoir}
% Adapted from https://tex.stackexchange.com/a/176815/14103
\usepackage{tikz}
\usepackage{xfrac}
\usetikzlibrary{fpu}
\newcommand{\dectofrac}[1]{\begingroup%
\pgfkeys{/pgf/number format/frac}% Format as fraction
\let\frac\sfrac% Let \frac act like \sfrac
\pgfmathprintnumber{#1}\endgroup}
\begin{document}
\chapter{First}
\chapterprecishere{\dectofrac{0.25}}
\chapterprecistoc{\dectofrac{0.25}} % Works fine when this line is
% commented out or the \dectofrac
% is not used
\end{document}
Compilation causes the process to run indefinitely without any error message. We can exit only using Ctrl-C which shows the following as terminal output:
Interruption. \pgfkeys@parse ...uturelet \pgfkeys@possiblerelax \pgfkeys@parse@main l.16 \chapterprecistoc{\dectofrac{0.25}}
When the line containing \chapterprecistoc is commented out
compilation proceeds without the slightest error. The culprit here is
the \dectofrac command since the \chapterprecistoc will work fine
if we don't use this command.
I am otherwise clueless here.

\NewDocumentCommand{\dectofrac}{m}{<same code>}would be sufficient: it doesn't require\protector another command. It is available becausexfracloadsxparse. – egreg Jul 24 '17 at 09:02<same code>referred to the original code in the definition of\dectofrac. I added the correct code. – egreg Jul 24 '17 at 09:21