The problem is the following.
If you have a charts state flow inside which is a simulink function and inside the simulink function and again state flows then local variables initialized in the latter are generated with duplicate names. It needs to be checked, but for now the output is like this