It is not currently possible to expand variables in needs:parallel:matrix.
There's an open issue in gitlab's issues https://gitlab.com/gitlab-org/gitlab/-/issues/423553
You need to either write every job separate or generate an yml file on the fly with the variables set correctly.