That’s basically because the dialplan interpreter is, basically, a text macro processor, so the Gosub sees what gets logged at verbosity 3.
I generally avoided anything needing quoting, as there is a lot of ad hoc parsing, and I’m never sure how they will be handled, but you could try double quotes. You might find you have to explicitly strip them. Otherwise you would need to use something like REPLACE, to change the , into something safe.
Hate string-substitution languages. Hate, hate, hate.
In POSIX shell syntax, special characters and word-splitting happens before the substitution of (quoted) variable values, not after. Even unquoted variable values only undergo word-splitting; any special characters they might contain, like redirection symbols etc, do not get their special interpretation.