syscall.PtraceGetRegs uses syscall.PtraceRegs. syscall.PtraceRegs depends on the host, e.g. if your binary is linux/386 syscall.PtraceRegs has 16 registers. But it's possible to run that linux/386 on an amd64 kernel, and attach to an amd64 process. In that case, syscall.PtraceRegs is not good anymore because the amd64 variant has 26 registers.
I have found this while trying to debug an arm64 Go process using an arm Go debugger.