As soon as the following (working) definition
\newcommand
{\TESTFRACTION}
{%
\makebox
[\widthof{${}\left(\frac{a}{1}\right){}$}]
{${}\left(\frac{b}{1}\right){}$}
}
is changed to one which also includes height
\newcommand
{\TESTFRACTION}
{%
\makebox
(\widthof{${}\left(\frac{a}{1}\right){}$},
\heightof{${}\left(\frac{a}{1}\right){}$})
{${}\left(\frac{b}{1}\right){}$}
}
! Missing number, treated as zero. error is generated on the same line where \TESTFRACTION is used inside equation environment.
Following is a working version to serve as a scaffolding to try to get \makebox' accept, both, width and height using\widthofand\heightof`
\documentclass{standalone}
\usepackage[alignedleftspaceno]{amsmath}
\usepackage{calc}
\usepackage{tikz}
\newcommand
{\TESTFRACTION}
{%
\makebox
[\widthof{${}\left(\frac{a}{1}\right){}$}]
{${}\left(\frac{b}{1}\right){}$}
}
\begin{document}
\begin{tikzpicture}
\path node
{%
$%
\begin{gathered}
\TESTFRACTION
\end{gathered}
$
};
\end{tikzpicture}
\end{document}

