Redshift returns this error when connections are set to read-only and variables and temporary tables are being created. Since Redshift creates temporary tables for each subquery, if your query contains subqueries then you will run into this error.
To resolve the error, disable read-only connections for your data source by going to the data source connections settings. Your database will still be protected by Chartio.
You can read more about read-only connections here.