Problem with XY Chart and script transform

I think binding update problems with XY Chart have been fixed in 8.1.22.
See the changelog.

4429: XY Chart Expression Tag History binding with dynamic path causes Component Error
Fixed an issue with the XY Chart where the chart would not load when using a dynamic expression tag history bindings and switching views.

This had been a big puzzle for me and as a workaround I was refreshing the page on load. The upgrade fixed it.