Your second example doesn't work for the same reason using $chr(44) in $replace works fine. Identifiers take parameters separated by literal commas, and each parameter is evaluated individually. It's the reason $+(a,$chr(44),b) is not the same as $+(a,,,b).

Another example that won't work: //var %t = 200,100,50 | echo -a $rgb(%t)

But you can use the [ ] evaluation brackets to get around this:
//var %t = 200,100,50 | echo -a $rgb( [ %t ] )

This way the variable is evaluated before the parameters are split up, so the commas it contains are taken literally.