[Client Script] Module: Quotes, Field: 'Quoted_Items' | setValue() --> internal API error

[Client Script] Module: Quotes, Field: 'Quoted_Items' | setValue() --> internal API error

Hello there,

I would like to use an client script to validate line items in quotes. So basically I get the value:

let quotedItems = ZDK.Page.getField('Quoted_Items').getValue();

do my logic and on the end I set the value:

ZDK.Page.getField('Quoted_Items').setValue(quotedItems);

But when I do this, I get an unspecific error:

"internal API error"

What am I doing wrong, how can I fix the problem?

Regards,
Sven