OPT creating strange composition problem

So some context, working on an application to facilitate the building of specific clinical blocks using simple ADL 1.4 templates built with Archetype Designer.
Templates and Compositions stored in ehrBase v0.30.0

Just recently had a very strange issue with a composition that could be submitted but not retrieved from ehrBase due to this error

_{"error":"Bad Request","message":"DB inconsistency:java.lang.IllegalArgumentException: Illegal unquoted character ((CTRL (truncated..._

Looking at the database I found the composition started like this

{

   "_type": "COMPOSITION",

   "name": {

      "_type": "DV_TEXT",

      "value": "\n                inflammatory_bowel_disease_control_prom_patient_1_bee15df5-0d8c-4eed-9f89-928ba930d28f\n            "

   },  

The newline character ( \n ) being the standout issue here.

OK so I figured I would isolate several items and just upload the template to openEHR toolkit, so handy thank Pablo :), and it generated a composition with the same structure.

I inspected the template, actually tested an older SEM_VER of the template in the toolkit and it was OK

{

   "_type": "COMPOSITION",

   "name": {

      "_type": "DV_TEXT",

      "value": "inflammatory_bowel_disease_control_prom_patient"

   },  

Is the new name of the template? I compared the 2 templates and found Archetype designer likes to reorder some things, mostly in the terminology section of the OPT when make adjustments.
I adjusted these back and it worked, the name.value was now without the “\n”. Should be good right?

Well no as I continued testing a few days later and the older template now works correctly in our application. So I jump into the openEHR toolkit and the composition it generates is working, I am confused.
I deleted the copies in there, uploaded the opt from the GitHub repo we have connected to Archetype Designer and tested it again, it works. So very puzzled.

I went to our QA environment, and tested compositions made with the template in question and they failed as before. I uploaded the same template again, overwriting the version that is in ehrBase, and testing them again it is working. _(ツ)_/¯

In all applications now, using the same template as last week, I cannot generate a composition with the same newline character “\n” before and after the name.value. Happy it’s working but supper puzzled as to why it did strange things.
I have been working with openEHR and ehrBase since January this year and the occurrence of stranger things is not uncommon, I hope this tale of woe is a reminder to all. If you have any insight please do share.