A 2GP (second-generation managed package) cannot be retrieved from a destination (new) Dev Hub org through the Salesforce CLI or other package recovery methods if the package was not transferred through the 2GP Package Transfer process before the source (old) Dev Hub was deleted.
When the source Dev Hub is deleted, package recovery is not possible. The customer must recreate the package in a destination Dev Hub.
This article explains why a Salesforce 2GP managed package cannot be retrieved from a destination Dev Hub when it was not properly transferred from the source Dev Hub, and what to do next. If the source Dev Hub is deleted, the customer must recreate the package in an active Dev Hub. If the source Dev Hub is still active, the package can be transferred using the supported 2GP Package Transfer process.
2GP packages are associated with the Dev Hub that owns them. The package management metadata required to build, view, and manage the package is maintained in that Dev Hub.
Authorizing the Salesforce CLI against a different Dev Hub does not make the existing package available. The package must first be transferred to the destination (new) Dev Hub through the supported 2GP Package Transfer process, which moves the required metadata.
If the source Dev Hub is deleted before the package is transferred, the package cannot be retrieved from another Dev Hub through the Salesforce CLI or other package recovery methods. The ability to build and manage the package is lost, and 2GP Package Transfer is no longer possible.
When the source (old) Dev Hub has been deleted, the customer must recreate the package in an active Dev Hub. If the source (old) Dev Hub is still active, the package can be transferred using the supported 2GP Package Transfer process, subject to its requirements.
005393434

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.