Google - Assistant crashed on Custom Code block

I’m trying to build a Google Assistant action with Voiceflow. I have a Custom Code block with the following code:

var stepsArray = [step1, step2, step3];
var current_step = stepsArray[stepcounter];

It works fine in the Voiceflow testrun, but Google Assistant crashes. If I replace this Custom Code block with a Set block which sets current_step to step1, everything works fine.

Am I doing something wrong?

Voiceflow support advised me to do the following:

Be sure that your variables already exist in your project and remove the var when you’re using global variables.

stepsArray = [step1, step2, step3];
current_step = stepsArray[stepcounter];

Unfortunately, this doesn’t fix the problem.

I checked all variables and stepsArray didn’t exist yet, so I added it to the model builder.
I removed the var, since they are both global variables.

But Google Assistant still crashes. It seems the webhookResponse includes an END_CONVERSATION command.