CacheFactory.getCache returning null in DataCenter


We have support cases where the CacheFactory.getCache() returns null in some costumers installations. The documentation marks the method as @NonNull, so it shouldn’t return null. Atlassian Cache - API 2.9.0 API

We never could reproduce it locally, but we get the same error report about this crash from different installation once in a while.

The cache is a pure local cache:

CacheFactory cacheFactory = ....
 CacheSettings cacheSettings = new CacheSettingsBuilder()
    .expireAfterWrite(1, TimeUnit.DAYS)

Cache<String, String> c = cacheFactory.getCache<String, String>(
      "ch.mibex.stash.sonar4stash:sonar-component-cache", null, cacheSettings)'

I’ve found a similar issue, but for JIRA without any answers: Atlassian cache - cacheManager.getCache returns null
Has any idea on what the cause could be? Or how to fix it on these installations.