UseHealthChecks and MapHealthChecks have subtle differences, UseHealthChecks allows you to capture any endpoint on a port when using null or empty PathString, MapHealthChecks does not allow this, using null throws an exception, and an empty string is just the equivalent of /.
They both use the same middleware HealthCheckMiddleware behind the scene. The MapHealthChecks is an extension method on IEndpointRouteBuilder, whereas UseHealthChecks is an extension method on IApplicationBuilder.
Here is a reference to the source for reference.
https://github.com/dotnet/aspnetcore/tree/main/src/Middleware/HealthChecks/src/Builder
If you look at the source you will see that UseHealthChecks uses MapWhen() where MapHealthChecks uses Map()