Shortly after posting I got an idea: I normally write in Norwegian language, and even if the templates just have a few words exept for the variables, these words are in Norwegian. I have now looked at my 4 different templates and they all contain the Norwegian character written as an "a" with a circle above: å
I tried making a template without this character, and then everyting worked fine. So my guess is this is an encoding issue. I will look into this further and post my results here.