What worked for me was removing the:
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
It'd been deprecated and it doesn't match the version of <PackageReference Include="AutoMapper" Version="14.0.0" />
installed.