nuget package references are stored in the project file. you probably did not save the project file after updating the packages. so when reopened it was reverted. you should save all after updating packages. you should also delete the bin & object folders before doing a restore/build.
I suspect your dotnet workloads need updating or are corrupt. The Maui and Aspire workloads are often problematic:
https://video2.skills-academy.com/en-us/dotnet/core/tools/dotnet-workload