The Puppet Agent MSI package on Windows puts environment=production in puppet.conf by default even if PUPPET_AGENT_ENVIRONMENT is left out during installation time.
The affect of that is that the $agent_specified_environment fact will always have a value, and will never be undef. This ultimately breaks the commonly used agent-specified environment workflow described here: https://docs.puppet.com/pe/latest/console_classes_groups_environment_override.html#workflow
On *nix Puppet agent installations, the environment key is left out of puppet.conf. During a Puppet run, the agent will still request the production environment by default and the $agent_specified_environment fact is left undefined.
The commit here notes that this behavior was intentional.
It would be ideal if the Puppet Agent behaved the same on Windows and *nix platforms. This way, special exceptions would not need to be made in Puppet code or in the Node Classifier.
What I ended up doing to account for this difference was put a rule in my agent-specified node group of 'agent_specified_environment' is not 'production'. That, combined with the recommended 'agent_specified_environment' matches regex '^.+', ended up giving me the desired outcome.