Let’s begin with not using the templater automating insertion function. See if the problem persists.
What is the output of show debug info command? You haven’t provided that info in your initial bug report.
Long term, Does this problem happen with restricted mode on?