BUG: Unable to return certain classes when using commandContext.getDbEntityManager().getCachedEntitiesByType

When using commandContext.getDbEntityManager().getCachedEntitiesByType() as part of the internal API (in this case i am accessing through a Class that implements TaskListener and am using a snippet such as:

                .addTransactionListener(TransactionState.COMMITTING, commandContext -> {

A line such as: HistoricActivityInstanceEventEntity activityInstance = commandContext.getDbEntityManager().getCachedEntity(HistoricActivityInstanceEventEntity.class, taskActivityId); works as expected.

But when you try and use the getCachedEntitiesByType method to get a list, it does not appear to work for at least the HistoricVariableUpdateEventEntity class. There is no error. The returned array is just empty.