Based on what @Grismar said, it sounds like the answer is that the locals() built-in function only shows things defined in the local scope. In other words, if we define Python scoping as LEGB, locals() only displays the "L" part. For what I was trying to do, I need to use the globals() built-in.
As for VS Code, it appears that when using the Python debugger in VS Code that locals() displays more than just the "L" scope. However, I believe pdb is the definitive debugger and that only shows things in the "L" scope.
Finally - is what I'm trying to do a good idea? Maybe/maybe not. In a nutshell - I'm doing Cloud hosted code challenges. The cloud environment defines their own variables (globals) that make sense for them (a Linux hosted environment). I choose to solve the challenges locally on a Windows environment. My environment is quite a bit different, so I define my own variables that make sense for my environment. I want to do something generic that works in either environment, so I check if my variable is defined. If yes use it, if no fallback to the cloud definition. There's probably a better way to do this and I'm open to suggestions.
Thanks for all the feedback.