This is because the path is too long. You can refer to this issue: Maui - some nugets do not work as path is too long "Could not find a part of the path".
And jfversluis comment:
this is not a .NET MAUI problem but wider spread and older.
And this has been reported on the Visual Studio Community:Allow building, running, and debugging a .NET application in a long path. And you can try to enable the long path.