A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Dear Keith,
Welcome to our forum here.
I did a test and I can reproduce the issue in your environment. I can create a pivot table via Office Scripts but the error comes when running the chart label command. I checked the code and I think that the code may be correct.
As we have a specific support channel Q&A forum-Office Scripts coping with Office Scripts related issues, I suggest you post a new thread there to see if there are some code issues when using the feature.
Sorry for that our category may have limited resources on further investigating the source code page.
Thanks for your understanding and have a nice day!
Cliff