When you are developing packages is quite common to have them directly in the Packages folder, but this folder is not scanned, and thus csproj files are not processed correctly. When the package is published and downloaded using UPM it works fine.
The ScanAndProcessKnownFolders (UnityProjectInfo.cs:461) should contain an additional call to ScanAndProcessFiles with PackagesPath.
This is how the method should look.
private void ScanAndProcessKnownFolders( Dictionary<string, Action<string, Guid>> extensionCallbacks) {
ScanAndProcessFiles(Utilities.AssetPath, extensionCallbacks);
ScanAndProcessFiles(Utilities.PackagesPath, extensionCallbacks);
ScanAndProcessFiles(Utilities.PackageLibraryCachePath, extensionCallbacks);
}