Thanks for all the help!
I initially setup Influx based on the below manual:
https://community.openhab.org/t/influxdb-grafana-persistence-and-graphing/13761
There it’s recommended to set auth-enabled = true. The script started to work immediately after setting the parameter to false.