Firstly, drop off the "-s" from your curl line. Or use "-Ss" if you want to suppress output in non-error situations, but still see errors when they occur.
That should give you a visible error message:
curl: (3) URL using bad/illegal format or missing URL
So the problem is that curl itself is rejected the URL as malformed - it's not even getting to Prometheus.
Then trim it down to see where the problem occurs
"$URL/api/v1/query_range" # this is OK (at least, the request reaches Prometheus and gives an error about missing start value)
"$URL/api/v1/query_range?query=(sum(rate(container_cpu_usage_seconds_total{pod!=\"\", container!=\"\"}[1h]))by(namespace))" # this is rejected by curl
"$URL/api/v1/query_range?query=(sum(rate(container_cpu_usage_seconds_total{pod!=\"\",container!=\"\"}[1h]))by(namespace))" # this is accepted
I needed to remove the space after the comma in the URL.
As for the plus sign: "+" is actually the way to represent a space in a URL ("%20" is another way). If you want to insert a plus sign, then use %2B
With all those changes, that gives:
$ curl -Ss -g -k -X GET -H "Authorization: Bearer $TOKEN" -H 'Accept: application/json' -H 'Content-Type: application/json' "$URL/api/v1/query_range?query=(sum(rate(container_cpu_usage_seconds_total{pod!=\"\",container!=\"\"}[1h]))by(namespace))&start=2022-08-21T07:00:00%2B03:00&end=2022-08-21T09:00:00%2B03:00&step=1h"
{"status":"success","data":{"resultType":"matrix","result":[]}}
(although you don't actually need the "Content-Type: application/json" header, since your request has no body)