It is not good programming to put a return in the middle of the switch.
Different compilers behave differently an whilst the better established ones on larger processors generally work better, it would be better if lend a hand to the compiler. The problem you encounter is probabely the compiler does not clean up the stack properly when it encounters the return where you've put it.
This is not usable compiller if it not correctly handle return from SWITCH:CASE ......
Maybe this is not good programming style, but it must working.
This construction allow make programm smaller and faster, because
you do not nead temp variable, where storing returned value.
Also this is normal case for parameter range checking and returning error codes ...
It's just a very small tips C-programming.
Maybe it's useful to embeded microcontroller programmings.
Please consider using a global variable in your program like belows.
============================================
unsinged char something;
void main(void)
{
... here you can use variable of something.
...
switch(NODE)
{
CASE 'a': ....
return(something);
break;
CASE 'b': -...