Branch preview deployment fails

I’ve set env variables for Prod, Dev and Preview. When I push a new branch the build always fails due to missing variables. If I redeploy it usually works (but not always). It’s as if the preview variables for the branch get created right after the deployment kicks in. Prod and Dev deploys correctly all the time.

Is this a known issue or am I doing something wrong?