The reason is actually much simpler.

The label is in the local scope, so is simply not visible in the function.

You can declare the same subroutine within the function itself, and then it will work.