Type declarations in functions are only scoped from the point of their declaration until the end of the function.
So the reason you can not do the recursive type definition in a function is that at the point of the first declaration, the second is not yet in scope.
Package scoped declarations are different from function scoped definitions, because in a function, you have a notion of "progress" - one statement comes after the next. At the package scope, that isn't he case. All package scoped declarations are "simultaneous", in a sense. That was intentional, to avoid an issue C has, where you have to sometimes declare a function before separately, to get mutual recursion.
I think it would have been possible to make type declarations apply to the entire function scope. But that wouldn't even solve the entire issue - for example, you run into a similar problem when defining recursive functions locally. Python does actually solve this by making every declaration apply to the entire function scope - but that has its own surprises. Either way, it's a decision that was made and we can't really reverse it now, as it would break existing code. For example, you can do this today:
func F(x int) {
x = 42
type x string
var y x
}
which would presumably break.
Ultimately, you just have to bite the bullet here and define your types at package scope. You can always solve name spacing issues by splitting it up into separate packages.