Wait a second - now that you mentioned it I am even more puzzled by the repeated mention of Python, since https://www.tt-wiki.net/wiki/NMLTutorial/Installation mentions on one hand that "NML is written in Python" but at the same time below it is mentioned about the Windows version that "NML is available as pre-built (64-bit) Windows executable" which would mean that in that form, by itself it should NOT require Python.
Maybe some of the more expert people can comment on this - precisely: "Does nmlc itself require a Python installation on a Windows system"???
Could it be that you are trying to create *.grf files from *.nml that is based itself on a Python file? Because some NewGRF definitions are not written directly in *.nml but instead use a *.py Python file to create the *.nml which is easier if you have a lot of stuff that repeats.
That could also be a reason for the erratic behaviour you observe - maybe check if when you try to build a "nml-only" NewGRF it works, but if compiling a "Python-to-generate-nml" it does not? Because then the problem would not be with your nmlc but the Python installation, which should be separate.
Can you maybe try the attached NewGRF which is *.nml only with no Pyhton in the back? Should be pretty familiar to you in the basic structure as it is based on OTIS and a still not finished attempt to use this for my own industry set.
It compiles without problems on my computer, only throwing a few warnings.
Maybe the problem can be narrowed down this way.
For testing the other way round - could you maybe share one of your non-running but simple *.nml with me to check if it runs on my installation?
This is really a nut that should be crackable ...