Package metadata can be retrieved for only second-generation managed package version, incorrect release note
https://github.com/forcedotcom/cli/blob/aaea86f6de6087acbd49d48691368f3858541df5/releasenotes/README.md?plain=1#L45
NEW: Retrieve package metadata for a specified package version with the new package version retrieve command. Package metadata can be retrieved for only second-generation managed package versions or unlocked packages.
Actual result using a 2GP package that is not an upgraded 1GP package
Error (DownloadDeveloperPackageZipHasNoDataError): Can't retrieve package metadata. We're unable to retrieve metadata for the package version you specified. Retrieving package metadata is available to converted 2GP package versions only. If the package you specified is a converted 2GP package, try creating a new package version, and then retry retrieving the package metadata for the new package version. If your package is a 1GP, start by converting the package to 2GP, and then retry retrieving metadata from the converted 2GP package version
Hi @nwcm this might be a server-side problem.
I'll need to see the log of the operation to be sure. Can you run the command with --dev-debug flag and share the log?
Hi @nwcm . Your use case (running package version retrieve on a non-converted 2GP package) is supported, but you need to set something first. I'm hunting down the info, stay tuned.
@nwcm The field which drives the generation of the zip is Package2VersionCreateRequest.IsDevUsePkgZipRequested. At the moment the CLI does not expose a parameter to set this value but it can still be used via the API directly.