This is most likely related to how n8n internally evaluates expressions and converts strings to JSON. The most reliable way to get around it is to make the entire thing an expression (which means you’re using js object syntax instead of dealing with quotes, etc. in JSON syntax), and then convert it yourself at the end using .toJsonString()… like this:
{{
{
someAttribute: "some value",
someFieldWithVariableContent: "The firstpart of the content " + ${'othernode'}.item.json.someAttribName + " and the last part"
}.toJsonString()
}}
In the preview, you’ll see how this fixes up all the quoting, array syntax, etc. and gives you valid JSON output.