Thank you Marco - have just verified that compiling with -Ur does indeed fix the issue. Never knew about that switch before now.
It's good to find the issue is already known.
Would there be any benefit in me attempting to produce a minimum reproducible set of source files that trigger the error? Or is the cause already understood? I'm not particularly looking forward to trying to cut down such a complex interconnected web of a project, but I will do so if it could be helpful.