The parsing in Microsoft.NET.TargetFrameworkInference.targets needs to be updated to parse the TargetPlatformIdentifier and TargetPlatformVersion from the TargetFramework.
The existing parsing implementation (which uses string manipulation) should be replaced with calls to new MSBuild Intrinsic functions which will call the NuGet parsing APIs.
.NET 5 TargetFramework spec