Missing FROM-clause in RETURN QUERY EXECUTE FORMAT loop
It turns out that I simply needed to quote the table name passed to the function:
RETURN QUERY EXECUTE FORMAT('SELECT %L as metric_name, hypertable_size(''prom_data.%I'') as raw_size', metric_table, metric_table);