This is essentially an expansion on my earlier problem (Chemfig curved arrows in the wrong place) to which I have found a fix, but not really a solution.
I made a document using a header file which I called in my main document with \include{chem-hdr}.
Here is what this file looks like:
% LaTeX header file for chemistry
% Packages
\usepackage{chemfig}
\usepackage[version=4]{mhchem}
\usepackage{siunitx}
% Chemfig settings
\setchemfig{atom sep=2em}
% Print atoms with a sans-serif font
\renewcommand*\printatom[1]{%
\ensuremath{\mathsf{#1}}%
}
This would cause any curly arrows to be placed beside my reaction scheme, instead of inside. In this incomplete reaction scheme, the arrow should be on the aldehyde.
Now with the background covered here's my actual problem:
In my earlier question, I did not specify that I used a header file; instead, I just pasted the header-file code into the MWE. I assumed this would make no difference. But it does!
Replacing the \include{chem-hdr} line in my preamble with the actual code in the file makes everything work as expected.
Would anyone happen to know why?
Thanks all.

\inputworks as expected. What do you know! Thanks for the help. – ajzcole May 25 '21 at 05:36\includedoes not work in the preamble, really we should make it an error, or at least give a warning – David Carlisle May 25 '21 at 06:41\includeand use\input. The former command is *only* to be used insidedocumentand used to be handy in older times when running LaTeX on big documents might cause excess of coffee-drinking while waiting the run to finish. Nowadays it's rarely needed. – egreg May 25 '21 at 08:37