I prefer this solution as it is in full accordance with the documentation and
with no need also for beginners to fiddle into internals .
https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_flist

<snip>

  • $LIST(list,position,end) returns a “sublist” (an encoded list string) containing the elements of the list from the specified start position through the specified end position (inclusive). If position and end specify the same element, $LIST returns this element as an encoded list.

</snip> 

(XMLPROJECTION="wrapped");

should separate your items.

from docs:  https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GXMLPROJ_basics#GXMLPROJ_basics_collections

Effect of XMLPROJECTION on Collection Properties

Value of XMLPROJECTIONEffect on Collection Properties
"WRAPPED"The property is projected as an element with subelements; each subelement corresponds to an item of the collection. This is the default for collection properties.
"ELEMENT"Each item in the collection is projected as an element, without being wrapped in the parent property.
 

my personal rule:

  • In the development stage, programmers should have full access but data are anonymized.
  • In the test stage - only some qualified developers get limited access
  • in the production stage, neither users nor developers should have access to the studio or terminal.
    Access is given only temporary, to top experts for error analysis.
    That's like the doctors that take care of places of your body you won't' show to anybody else.

     

normally there is no need for such "wrapper"

typically %Save() returns a %Status object and then it's up to you to analyze it in case there is an error.
In the situation described here, all you can do is just a retry. 
- it could be a Lock collision 
- or the LockTable is full.  
Instead of fiddling in system parameters requiring a restart, you just wait and retry. 

if you are curious how often this happens you may add a loop counter. for further decisions