Don't use GOTO in a subroutine which is called by GOSUB.
When the program calls a subroutine with GOSUB, the pointer will be stacked, and when the program executes RETURN, the stacked pointer will be flushed.
A subroutine which is called by GOSUB should be finished by RETURN.