The compiler should be complaining about the lack of a return statement in the function that is defined to return a byte, when you comment out the return statement. But, since warnings are disabled in the IDE, you don't see it.
If the function SHOULD return a value, you need the return statement to define what to return. If not, you have selected the wrong type for the function.