After months of trying to get
#Asterisk and
#FreePBX to compile on an arm64 system unsuccessfully, I bit the bullet and put it on a amd64 system with Debian Bookworm and it just worked. I'm kicking myself for trying to do it the hardest way possible for as long as I did.