Json value may consist of a string value. eg.:
postgres=# SELECT to_json(\'Some \"text\"\'::TEXT);
to_json
-----------------
\"Some \\\"text\\\"\"
There is no way in PostgreSQL to deconstruct a scalar JSON object. Thus, as you point out,
select length(to_json('Some "text"'::TEXT) ::TEXT);
is 15,
The trick is to convert the JSON into an array of one JSON element, then extract that element using ->>.
select length( array_to_json(array[to_json('Some "text"'::TEXT)])->>0 );
will return 11.