Error when uploading plugins [self-hosted]

The script, you refer to, is not meant to purge the database. It’s simply meant “to clear records older than 30 days in dtable_db database” - as explained under the link in your post. So you expect a behavior the script was not designed to bring about.