In Gen 3, the production branch is master, but the Config->onProduction() does:
$prodBranch = $this->onDedicated() ? 'production' : 'master';
Which results in false while in fact you are on "production".
I don't know if there are variables to check if you are on Gen 3, but that would need to be included in the code.