The assignment-form syntax f(x) = 5 and the equivalent function ... end syntax both implicitly declare f a const name in the definition’s global scope. This also occurs for struct definitions. A const name means that reassignment is undefined behavior or an error. Conversely, a non-const name cannot be made into a const name afterward; this threw the error you saw. Note that adding methods to an existing function or type like f() = 0 or replacing a method f(x) = 7, is not reassigning f. You’d need actual assignment syntax f = ... to try that.
The compiler can do some great optimizations when accessing const names; they’re actually necessary to let function calls and type instantiations be optimized at all. For example, if you defined f = x->5 and g(x) = f(x), g cannot assume f will be the same function and cannot be optimized much. You can get around this with some higher order functions like g(foo::Function, x) = foo(x), but you probably prefer to access global names rather than pass every function and type through the arguments like g(f, x).