Today WebApplicationBuilder has some hacky logic to synchronize the WebApplicationBuilder.Services IServiceCollection and the HostBuilder's IServiceCollection in case any custom services have been added via HostFactoryResolver. This logic can be found here.
The synchronization is not perfect and can lead to bugs like the following throwing even though the equivalent would work in Startup.ConfigureServices when using the HostBuilder directly.
builder.Services.BuildServiceProvider().GetRequiredService<IHostApplicationLifetime>();
We should look into adding an API to HostBuilder to share an IServiceCollection with the WebApplicationBuilder.
Related: #61634