Actions rejects matrix expressions in step.shell before any job starts. Give the four shared steps a literal shell and select their existing x64 container or native arm64 Bash via the matrix label in job env.