I've just tried that exact code and it works fine. Can you post the actual error message? You haven't changed the name of the default audio group have you (through Tools>Audio Groups)?
I'm making end credits in a project, and before the credits roll all volume will fade out, which I've done with audio_master_gain, but I wanted to switch it to audio_group_set_gain, so I could turn down the volume only on the default group, and then keep the volume for another group that has the credits theme (and a few other themes). but I get an error.
So when the game is set to end, I have a variable
"global.endgame = 1;"
So if that one is set to 1, it will start to fade the audio group out like
audio_group_set_gain(audiogroup_default,0,5000);
So when the game ends and the varaible is set to 1, I get this error:
############################################################################################
FATAL ERROR in
action number 5
of Step Event0
for object quit:
Variable quit.audiogroup_default(100922, -2147483648) not set before reading it.
at gml_Object_quit_StepNormalEvent_5 (line 12) - audio_group_set_gain(audiogroup_default,0,5000);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_quit_StepNormalEvent_5 (line 12)
Maybe it has to be set in game start / create event? as the gain here is set in a step event.