Example: https://perchance.org/3o1sbun1w3#edit
Seems like what’s returned at the end of the square brackets is somehow added, instead of setting what replaces the square brackets. Potentially, it’s cleared, then the square brackets are processed, then the result of the square brackets is added?
In another comment on this post I talked about my own expectations.
And that example I linked to in the post has some very weird behaviour being demonstrated.