This has some of the same symptoms as https://github.com/NuGet/Home/issues/9332 but may not be the same issue; it happened under different circumstances and this time I was able to assemble a small solution that can reproduce the problem.
NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): NuGet.exe
NuGet version (x.x.x.xxx): 5.8.0.6930
dotnet.exe --version (if appropriate): n/a
VS version (if appropriate): 16.8.3
OS version (i.e. win10 v1607 (14393.321)): Windows 10
Worked before? If so, with which NuGet version: 5.3?
Unzip attached Repro.zip archive
Restore the repro solution with nuget.exe and -ForceEvaluate => should succeed
nuget restore -ForceEvaluate Repro.sln
nuget restore -LockedMode Repro.sln
NU1004: The packages lock file is inconsistent with the project dependencies so restore can't be run in locked mode. Disable the RestoreLockedMode MSBuild property or pass an explicit --force-evaluate option to run restore to update the lock file.
NU1004: The packages lock file is inconsistent with the project dependencies so restore can't be run in locked mode. Disable the RestoreLockedMode MSBuild property or pass an explicit --force-evaluate option to run restore to update the lock file.
I can reproduce this issue following the repro steps.
Dup of https://github.com/NuGet/Home/issues/10326.
Fixed in 5.9.0-preview.2 https://dist.nuget.org/win-x86-commandline/v5.9.0-preview.2/nuget.exe