client's cms keeps dumping duplicate id fields into the same json-ld block. search console is just throwing errors because it can't parse the mess. use a quick regex filter in your build script to strip the second occurrence of @id before the final deployment.
never trust the cms output directly if you're pulling from multiple api endpoints.
data.replace(/("@id":\s*"[^"]*"\s*,?){2,}/g, (match) => {return match.split(/"@id":/)[0];})it's a stupid hack but it stops the 'duplicate key' warnings from breaking the whole script.