I faced this same problem a while ago, and it boils down to the following:
The error occurs because the channel_name and user_id variables are being passed incorrectly in the fileNamePrefix field due to a special character.
In my case, when I tried to set the channel_name variable similar to what you were doing, I did it as follows: "emergency_channel_123", which generated the error.
The solution was to set it as follows: EmergencyChannel123