I just changed the the build action in the file properties to another and back to MauiIcon again. So the reference is set new and there is no longer an error.