The problem faced here is the mixing of variant aware dependency resolution and legacy resolution.
In the project tab-core-crypto
you use a platform
dependency which means you opt-in the richer feature set of Gradle for dependency resolution. However it seems you did not opt-in publishing Gradle Module Metadata but instead relied only on Ivy.
However Gradle cannot express fully what happens then. The platform-runtime
configuration does not exist for real in the Maven metadata. It is computed at runtime by Gradle.
But since there is an explicit configuration in the Ivy metadata, that computed metadata is not considered.
I would recommend upgrading Gradle as the publication of Gradle Module Metadata was not stable in 5.6, and making sure it is published and consumed. This would allow Gradle to use metadata fully explicit about what to consume.
As for why this only happens in some builds but not all, a reproducer would be needed with details on which tasks are invoked when it passes and when it fails.