This problem doesn't reproduce when I build Go from source at that commit:
gotip $ git status
HEAD detached at becaeea119
nothing to commit, working tree clean
gotip $ cd src
src $ ./make.bash
Building Go cmd/dist using /usr/local/go. (go1.18beta1 darwin/arm64)
Building Go toolchain1 using /usr/local/go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for darwin/arm64.
Installed Go for darwin/arm64 in /Users/gopher/gotip
Installed commands in /Users/gopher/gotip/bin
src $ export PATH="$(pwd)/../bin:$PATH"
src $ which go
src $ go version
go version devel go1.18-becaeea119 Tue Dec 14 17:43:51 2021 +0000 darwin/arm64
src $ go run /tmp/demo.go
I clone the new version of source code, use ./all.sh and compile successfully. But when I use the binary file to run demo.go
Did you add go to PATH after running all.bash?
What does which go print?
In your go env, it says the inferred value of GOROOT is /usr/local/go. If you tried to build Go in another directory, then the problem is that the wrong directory is being used. This is possibly because the wrong go binary is in PATH.