Why Gradle doesn't take dependency version from platform?

I have a ProjectA with a platform published to a Maven repository.
I made some constraints in that platform for grpc dependencies:

dependencies {
    constraints {
        val grpcModules = setOf(
            "grpc-all",
            "grpc-alts",
            "grpc-android",
            "grpc-api",
            "grpc-auth",
            "grpc-benchmarks",
            "grpc-binder",
            "grpc-census",
            "grpc-context",
            "grpc-core",
            "grpc-cronet",
            "grpc-gcp-observability",
            "grpc-googleapis",
            "grpc-grpclb",
            "grpc-inprocess",
            "grpc-interop-testing",
            "grpc-netty",
            "grpc-netty-shaded",
            "grpc-okhttp",
            "grpc-protobuf",
            "grpc-protobuf-lite",
            "grpc-rls",
            "grpc-services",
            "grpc-servlet",
            "grpc-servlet-jakarta",
            "grpc-stub",
            "grpc-testing",
            "grpc-testing-proto",
            "grpc-util",
            "grpc-xds",
            "protoc-gen-grpc-java",
        )
        grpcModules.forEach { artifactId ->
            api("io.grpc:$artifactId") {
                version {
                    strictly(getVersion("grpc"))
                }
            }
        }
    }
}

When I use this platform in ProjectA with api(platform(project(":platform"))) everything is OK.
But ProjectB cannot find a version that satisfies the version constraints:

      > Cannot find a version of 'io.grpc:grpc-netty' that satisfies the version constraints:
           Dependency path '***' --> '***' (runtimeElements) --> 'dev.openfeature.contrib.providers:flagd:0.6.9' (runtime) --> 'io.grpc:grpc-netty:1.60.1'
           Constraint path '***' --> '***' (runtimeElements) --> '***:platform:***' (runtimeElements) --> 'io.grpc:grpc-netty:{strictly 1.58.1}'
           Constraint path '***' --> 'io.temporal:temporal-sdk:1.22.3' (runtimeElements) --> 'io.grpc:grpc-bom:1.54.1' (platform-runtime) --> 'io.grpc:grpc-netty:1.54.1'

Why it doesn’t work?
Does it mean that the platform is only list of constraints and somewhere should be specified dependency io.grpc:grpc-netty with version 1.58.1?
This only helps in a ProjectB:

dependencies {
    api(enforcedPlatform("***:platform"))
    ...
}

But why it doesn’t work with api(platform("***:platform"))?

Why it doesn’t work?

Hard to guess, I tried to replicate the setup but couldn’t get it fail.
Can you share an MCVE that demonstrates the problem?

Does it mean that the platform is only list of constraints

yes

and somewhere should be specified dependency io.grpc:grpc-netty with version 1.58.1 ?

no,
“only a constraint” means that it does not introcude an actual dependency, but if the dependency comes in through some way, then the constraint takes part in dependency resolution as normal.

Your setup sounds fine on first look and as I said, I couldn’t make it fail like you showed, so there must be something special to your setup that you did not mention yet.

enforcedPlatfrom is the big-hammer last-resort way for end products if they really must use it, but usually you should be better off without it.