new pulumi.StackReference(name) reads the outputs of another stack, and the name must be fully qualified as organization, project, and stack, for example acme/networking/prod. A bare stack name resolves against the current project and fails with a stack-not-found error when the target lives in a different project.
Outputs read this way come back as Outputs and, if the source marked them secret, as secret Outputs. requireOutput throws when the key is absent; getOutput returns undefined, which then surfaces as a confusing null property much later in the program. Prefer requireOutput so the failure is immediate and names the key.
Stack references create a read dependency, not an ordering guarantee. Pulumi does not deploy the referenced stack first, so a fresh environment must be brought up in dependency order manually or through an orchestration layer. The reader also needs read access to the referenced stack in Pulumi Cloud, which is a separate permission from deploy access and is a common cause of a CI failure that works locally.