In packages.config projects, when a package with build props or targets was installed, NuGet would add an EnsureNuGetPackageBuildImports target to verify that the packages msbuild content has been imported before building.
If the target has been modified manually, NuGet might not be able to detect that it needs removed when migrating.
If your project is PackageReference and you still have this target in project file, it should be safe to remove.