Hi,
Where did you got this script from ?
It is long_time no longer supported by Greenbone. So please contact the maintainer of this script to help you debug this issue.
As well your GVM Version is end of life / support as well. I would go with a supported version.