I don’t know how different building HashLink is compared to the Haxe compiler, but I found that using the Apple Silicon version of Homebrew didn’t work to build HashLink. I needed to do some special things to force the HashLink build process use the Intel version of Homebrew instead.
So maybe there are similar requirements for the Haxe compiler. Here’s the thread where I posted my findings for HashLink. Maybe it’ll provide some clues: